c# - Unable to Split the string accordingly -


i know question have been asked infinite number of times, i'm kinda stuck. have string

"doc1;doc2;doc3;12"

it can

"doc1;doc2;doc3;doc4;doc5;56"

its few pieces of strings separated semicolon, followed number or id.

i need extract number/id , strings separately. exact, can have 2 strings: 1 having "doc1;doc2;doc3" or "doc1;doc2;doc3;doc4" , other having number/id "12" or "34" or "45" etc. , yeah using c# 3.5

i understand pretty easy , witty question, guy stuck. assistance required experts.

regards anurag

string actual = "doc1;doc2;doc3;12"; int lstindex = actual.lastindexof(';'); string strvalue = actual.substring(0, lstindex); string id = actual.substring(lstindex + 1); 

Comments

Popular posts from this blog

javascript - JS causing window size to be bigger than necessary - Dropdown bug -

php - Calling a template part from a post -

How to mention the localhost in android -