Split Particular Digit using C#
-
hello Friend i have to know how to split below string in particular part. i have find this type of string in bar-code scanner as a input
I have a input
Hide Copy Code
0.1042.5140.7043.037.000.005.063.613.761.70.062
and i want output
0.104
2.51
40.70
43.0
37.00
0.00
5.0
63.6
13.7
61.7
0.06please help me to solve this.
-
hello Friend i have to know how to split below string in particular part. i have find this type of string in bar-code scanner as a input
I have a input
Hide Copy Code
0.1042.5140.7043.037.000.005.063.613.761.70.062
and i want output
0.104
2.51
40.70
43.0
37.00
0.00
5.0
63.6
13.7
61.7
0.06please help me to solve this.
-
hello Friend i have to know how to split below string in particular part. i have find this type of string in bar-code scanner as a input
I have a input
Hide Copy Code
0.1042.5140.7043.037.000.005.063.613.761.70.062
and i want output
0.104
2.51
40.70
43.0
37.00
0.00
5.0
63.6
13.7
61.7
0.06please help me to solve this.
What is the basis or pattern for the split? You example appears random.
Peter Leow http://www.peterleowblog.com/ https://www.amazon.com/author/peterleow
-
hello Friend i have to know how to split below string in particular part. i have find this type of string in bar-code scanner as a input
I have a input
Hide Copy Code
0.1042.5140.7043.037.000.005.063.613.761.70.062
and i want output
0.104
2.51
40.70
43.0
37.00
0.00
5.0
63.6
13.7
61.7
0.06please help me to solve this.
-
string s = "0.1042.5140.7043.037.000.005.063.613.761.70.062";
List widths = new List() { 5, 4, 5, 4, 5, 4, 3, 4, 4, 4, 4 };
int index = 0;widths.ForEach( w => { Console.WriteLine( s.Substring( index, w ) ); index += w; } );