+ 1

what to do now if i wanted to remove specefic character from s string ?

https://code.sololearn.com/cGIxL9sKW3LE/?ref=app an example would be nice

17th Jul 2020, 5:51 AM
Zihan Sabah
Zihan Sabah - avatar
20 Answers
+ 1
Check this edited code which removes everything except cap's letters. you can change it to accept or avoid other ASCII also. Hope help full. https://code.sololearn.com/cS8ploMplotw/?ref=app
18th Jul 2020, 4:18 PM
naresh
naresh - avatar
0
https://www.sololearn.com/discuss/212413/?ref=app
17th Jul 2020, 6:25 AM
The future is now thanks to science
The future is now thanks to science - avatar
0
Samsil Arefeen what to do with my code?
17th Jul 2020, 6:56 AM
Zihan Sabah
Zihan Sabah - avatar
0
.I don't know about much string .I use char array for that but can do like that https://code.sololearn.com/cCJ4PM1QUe3z/?ref=app you don't have to use another string.
17th Jul 2020, 7:40 AM
The future is now thanks to science
The future is now thanks to science - avatar
0
Samsil Arefeen that actually helps. but what if i wanted to remove a whole bunch of specefic characteres?
17th Jul 2020, 7:52 AM
Zihan Sabah
Zihan Sabah - avatar
0
I modified my code please have a look and don't forget to give a '\0'in the last of char arr. Otherwise strlen function won't work.
17th Jul 2020, 8:04 AM
The future is now thanks to science
The future is now thanks to science - avatar
0
write the specific charter in the char arr.
17th Jul 2020, 8:05 AM
The future is now thanks to science
The future is now thanks to science - avatar
0
Samsil Arefeen can we use ascii in here ? lets say we want to only use letters which ascii value is 065-122.
17th Jul 2020, 8:08 AM
Zihan Sabah
Zihan Sabah - avatar
0
yes of course.
17th Jul 2020, 8:09 AM
The future is now thanks to science
The future is now thanks to science - avatar
0
can u give me an example?.I started a few months ago. after completing c++ course, i started try to do challenges and found out i dont know most other thing. there is no good video in youtube about this concept either.
17th Jul 2020, 8:14 AM
Zihan Sabah
Zihan Sabah - avatar
17th Jul 2020, 8:39 AM
The future is now thanks to science
The future is now thanks to science - avatar
0
Samsil Arefeen thanks. that helps. but what is strln? anyway need to do more research on web. but enough for today
17th Jul 2020, 8:44 AM
Zihan Sabah
Zihan Sabah - avatar
0
strlen()is a function that measures the length of the array
17th Jul 2020, 8:45 AM
The future is now thanks to science
The future is now thanks to science - avatar
0
mean string
17th Jul 2020, 8:45 AM
The future is now thanks to science
The future is now thanks to science - avatar
0
naresh thanks but what is this variable named size_t?
18th Jul 2020, 4:26 PM
Zihan Sabah
Zihan Sabah - avatar
0
Zihan Sabah size_t is unsigned long which is also a primitive data type.
18th Jul 2020, 4:29 PM
naresh
naresh - avatar
0
naresh also newstr.push_back(str[i]) in this line what did u do?
18th Jul 2020, 4:34 PM
Zihan Sabah
Zihan Sabah - avatar
0
Zihan Sabah push_back is a member function of string class here, where newstr.push_back(char) which append / adds that particular character to the end of the string every time this function called.
18th Jul 2020, 4:37 PM
naresh
naresh - avatar
0
@naresh thanks
18th Jul 2020, 4:38 PM
Zihan Sabah
Zihan Sabah - avatar
0
Just write it again and it will show the last string which you wrote
19th Jul 2020, 5:13 AM
Électro sparkz