Split the following string into a table: so1101111/2/32/A1/4a2/5/63/b832/8/39 The splitting result is: So1101111 So1101112 So1101132 So11011a1 So11014a2 So11014a5 So1101463 So110b832 So110b838 So110b839 Use any programming language... |
Static void main (string [] ARGs)
{
String STR = "so1101111/2/32/A1/4a2/5/63/b832/8/39 ";
Char [] Sep = new char [] {'/'}; // split the Separator
String [] arstr = Str. Split (SEP); // split the string
String Strout = arstr [0]; // The first string
Console. writeline (Strout );
For (INT I = 1; I <arstr. Count (); ++ I) // string replacement
{// Replacement rule: Only Child strings with the same length at the end are replaced.
Strout = Strout. substring (0, Strout. Length-arstr [I]. Length) + arstr [I];
Console. writeline (Strout );
}
Console. readkey ();
}
Http://topic.csdn.net/u/20110617/23/1ed26d6f-589a-47d5-a676-6d8cc6f15adc.html