You need to sign in to do that
Don't have an account?

How we can get only integer value and only Decimal value from string
Hi all,
I have one requirement i want to get only integer values and only Decimal values from string
Eg :
string str = 'Commercial-(Aug)Quoted-Count300Premium - 250.00-Sarah Orosc';
from hear i want only integer value 300
string str 2= 'Commercial-(Aug)Quoted-Count500Premium - 350.00-Sarah Orosc';
from hear i want only Decimal value 350.00
i am trying with one solution
String numberOnly = str2.replaceAll('[^0-9]', '');or
String numberOnly = str.1replaceAll('[^0-9]', '');
by using above conditions i am getting integer and Decimal values
Please me on this any one
Thank you,
Surender Reddy
Try Below Code Please Mark It As Best Answer If It Helps
Thank You!
Please use below tested code:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Please use tested code:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh