c# - How do I grab the last string from a index by detecting the comma? -


how grab last string index detecting comma? example: string = a,b,c,d or = ab, cd, ef, gh (the string of can dynamic) how last string i?? (i need answer c# , using low consume performance ways possible)

result: = ad, cd, ef b = gh

you can use string.substring along string.lastindexof method (char) index of last comma

string last = str.substring(str.lastindexof(',')+1) 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -