c# 2.0 - Help With pattern matching -


in code have match below 3 types of data

abcd:xyz:def def:xyz xyz:def 

where "xyz" real data , other part junk data. now, first 2 types below can split ':' , can array[1] position data ... give me correct one.

abcd:xyz:def def:xyz 

i not getting how can extract 3rd case. idea? please help.

thanks, rahul

string case1 = "abcd:xyz:def"; string case2 = "def:xyz"; string case3 = "xyz:def";  string result1 = case1.split(':')[1]; string result2 = case2.split(':')[1]; string result3 = case3.split(':')[0]; 

if understand question correctly.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -