Posted on: 4/22/2015 10:16:41 PM | Views : 630

I have a value from textbox example : AIO-CCC , what I need to do is to split it so that i get 2 strings the first one AIO in string[1] and  CCC in string[2] , Now sometimes the value in the textbox is AIO without the "-CCC" or whatever value , I still need to write 2 strings , in this case and using my  code below im not able to do it , what i need is 2 check so that if string 2 is empty i want to fill it with " 000" . 
below is my code , hope someone can help me : 
StringBuilder lawnumberthing = new StringBuilder(lawnumber.Text.ToString()); int index = lawnumberthing.ToString().IndexOf("-"); if (index > 0) string[1] = lawnumberthing.ToString().Substring(0, index); string XLAWNUMBER2 = lawnumberthing.ToString(); string output2 = XLAWNUMBER2.Split('-').Last(); Sring[2] = output2;

Go to the complete details ...