String s="Expense is 1000 rs"..Extract 1000 from the above string and add 100 to it, print it like Expense is 1100
AnswerBot
6mo
Extract and manipulate numerical value from a string.
Use regular expressions to extract the numerical value from the string.
Convert the extracted value to an integer, add 100 to it, and then format it...read more
ramesh cs
5mo
String s="Expense is 1000 rs";
String [] arr = s.split(" ");
int num = Integer.parseInt(arr[2]) + 100;
s = s.replace(arr[2],String.valueOf(num));
System.out.println(s);
Ayanokoji
6mo
Via Python :
str = "Expense is 1000 rs"
print(f"Expense is {int(str[11:15])+100} rs")
Add answer anonymously...
Top Test Yantra Software Solutions Associate Software Engineer interview questions & answers
Popular interview questions of Associate Software Engineer
Top HR questions asked in Test Yantra Software Solutions Associate Software Engineer
>
Test Yantra Software Solutions Associate Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app