java - logic for dynamic String using split function -
string x= "100,000" string []y=x.split(","); string z= y[0]+y[1] (give me expected result 100000)
my question
if x dynamic, may sometime has "2 comas". "3 comas" (1,00,000 or 1,00,00,000 ) dynamic, can used separate comas , combine string.
you can replace ',' nothing instead of splitting string. in java this:
s.replaceall(",","");
if want split need loop iterates on string parts , puts new string.
example in java:
string x= "100,000" string []parts=x.split(","); string z= ""; for(string part : parts){ z+=part; }
Comments
Post a Comment