How To fetch last Interger from string c++ | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

How To fetch last Interger from string c++

string s="id1=100",y="I=20"; How can I print 100,20 in cpp

13th Aug 2020, 6:26 AM
Gireesh Desineni
Gireesh Desineni - avatar
4 Respostas
13th Aug 2020, 6:35 AM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar
13th Aug 2020, 6:39 AM
Gireesh Desineni
Gireesh Desineni - avatar
0
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  what if there is a space after = ?!
13th Aug 2020, 7:25 AM
Gireesh Desineni
Gireesh Desineni - avatar
0
I mean chances are that you may have numbers on the left of = as well, so that would alao be a problem, so you don't need those numbers right, so the options which we have is to extract numbers after the equal sign, we can use this method and add a space in the delimetere variable Or we can use regular expressions
13th Aug 2020, 7:31 AM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar