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

How can i get number value from string
Hi all ,
i have one requiremnt i need to get numaric value from string field how can i get in apex
Eg: String name= 'Auto - New Business - Count;Premium - 500';
from above string name i nedd to fetch 500 how can i do that
i used one method
String name= 'Auto - New Business - Count;Premium - 500';
String substr = name.substringAfter('-');
system.debug('substr'+substr);
but hear i am getting - New Business - Count;Premium - 500' total value but i need only 500 .
how can i do that some one help me please
Thank you
Surender Reddy
Try Below Code Please Mark It As best Answer If it Helps
Thank You!
Hi Surender,
The below code will serve your purpose.
Please mark this as the correct answer for others.Thanks in advance !!
Hi,
Please find the solution.
Please mark it as the Best Answer if it helps you
Thank You