Last post Apr 19, 2013 08:32 PM by engcanada
Apr 19, 2013 08:06 PM|engcanada|LINK
I need to split Request.SeverVariable["REMOTE_ADDR"] into 4 parts seperated by "." and then reterive each value as
int ip1 = part1
int ip2 =part2
int ip3 = part3
int ip4 =part4
I am working with razor syntax .cshtml
Any help would be appriciated.
Apr 19, 2013 08:08 PM|beetledev|LINK
You can use the Split method for this:
string parts = s.Split('.');
Where s is the string you want to split.
Then the parts would be part, part, part and so on.
Apr 19, 2013 08:31 PM|engcanada|LINK
If the first part of the sting is part then would the second be part and so on?
If so, they all end up showing me the first part of the string.
Apr 19, 2013 08:32 PM|engcanada|LINK
Sorry my bad.