Glenn Patton

Glenn Patton

  • NA
  • 308
  • 82.6k

I need to insert spaces to string....

Dec 12 2012 12:13 PM
Hi All,

I need to insert some spaces to a string "12345678" needs to be "12 34 56 78" I belive there is a String format option to do the serperation but I'm having no luck finding it.

Any one any ideas.
Glenn
 
[Up Date]
Idea I had while typing this  

MessageBox.Show(SerialNumber);          

for (int i = 0; i < SerialNumber.Length; i++)

            {

              SerialNumberNew = SerialNumber.Insert(2," ");

}


almost worked ! almost I can get the space in the first place on the string. the space is moving down the string
MessageBox.Show(SerialNumberNew);

Answers (6)