You need to sign in to do that
Don't have an account?
Surender reddy Salukuti
How can i get integer value and Decimal value from string
HI all,
I have one requrement
string str1 = 'Commercial-(Aug)Quoted-Count300Premium - 250.00-Sarah Orosc';
string str2= 'Commercial-(Aug)Quoted-Count500Premium - 350.00-Sarah Orosc';
from the above two string from first one i need only integer value i.e : 300 only after getting the value i need to repalce that number with another number in the str 1name .
from second string i need only Decimal value i.e 350.00 only after getting the value i need to repalce that number with another number in the str 2name .
how can i do this please help me on this
Check different suggestions provided on below link.
https://salesforce.stackexchange.com/questions/42003/how-to-extract-a-number-from-a-string
If it helps, mark it as best answer.
Thanks!
You can use this for getting Integer values from Sting.
Integer.valueof(str.trim());
If you find your Solution then mark this as the best answer.
Thank you!
Regards,
Suraj Tripathi