What do you want to save?
Add Code snippet
New code examples
-
C# 2022-02-16 17:50:01
Request.ServerVariables["HTTP_X_FORWARDED_FOR"] get only one ipaddress
private string GetUserIP() { string ipList = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (!string.IsNullOrEmpty(ipList)) { return ipList.Split(',')[0]; } return Request.ServerVariables["REMOTE_ADDR"]; } Add solution -
Haskell 2021-09-26 10:34:02
haskell string split
-- There is a package for this called split. cabal install split -- Use it like this: ghci> import Data.List.Split ghci> splitOn "," "my,comma,separated,list" ["my","comma","separated","list&... Add solution
Best helpers
Ranking is empty