java - Separating a char from a String? -


i trying separate char following examples of inputs:

c450.00 c30 p100

i have char such "c" or "p" separated can work them alone, "450.00", "30", , "100" separated ints. easiest way this?

you can split string whitespace delimiter. afterwards use substring on every part of string. have c , 450.0 stings. cast second part of substring integer , done.

to split:

string[] parts = string.split(" "); 

to substring:

string first = parts[0].substring(0, 1); string second = parts[0].substring(1); 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -