C# split string of first character occurrence -


i thought simple kicking butt.

i have string 21. a.person want a.person out of this.

i try following 21

string[] pname = values[i, j].tostring().split(new char[] { '.' }, 2); pname[1] ??? 

values[i, j].tostring() = 21. a.person , yes i've verified this.

everyone giving alternate solutions when yours should work. problem values[i, j] must not equal 21. a.person

i plugged simple test..

    [test]     public void junk()     {         string[] pname = "21. a.person".split(new char[] { '.' }, 2);         console.writeline(pname[1]);     } 

what print? a.person (with space in front, because didn't trim space)


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -