Regular Expression Issue C# or Java -
i have string of text trying break pieces in loadrunner here 2 possible combinations of text
309-95-90570-0243-023-0030 222-627-90570-0365-042-0031
i need able break each section inside of "-
" separate variables.
for example variables need be
first variable - 309
first set , 222
second set
it gets tricky here second variable bc in first example contains 2 characters in second example contains 3 characters.
second variable - 95
first set , 627
second set
third variable - 90570
first set , 90570
second set
does know how accomplish this?
simply use split function. example:
string foo = "309-95-90570-0243-023-0030"; string[] bar = foo.split("-"); (string s : bar) { system.out.println(s); }
also make values string int integer.parseint(value);
Comments
Post a Comment