c# - How to split a string by multiple chars? -


this question has answer here:

i have string this: string ip = "192.168.10.30 | somename". want split | (including spaces. code not possible unfortunately:

string[] address = ip.split(new char[] {'|'}, stringsplitoptions.removeemptyentries); 

as leads "192.168.10.30 ". know can add .trim() address[0] right approach?

simply adding spaces(' | ') search pattern gives me

unrecognized escape sequence

you can split string, not character:

var result = ip.split(new string[] {" | "}, stringsplitoptions.removeemptyentries); 

Comments

  1. The Hard Rock Hotel Lake Tahoe - Casino of Iowa fun88 soikeotot fun88 soikeotot 온카지노 온카지노 betway login betway login 599G5 giants over under wins on a new slot machine

    ReplyDelete

Post a Comment

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -