+ 1
How to remove extra spaces?
How to remove extra spaces? Under the extra spaces means more spaces in a row, for example: I (two or more spaces) student! Dizzy already... you know... Session, exam. Left 4 tickets 40. Others have decided. translate Google ĐĄ++
6 Answers
+ 1
@Cain Eviatar, this code removes all spaces.
+ 1
@expert sorry about that, lemme fix it.
0
im not familiar with c++, but you can do that with regex, something like : str.replace("\s{1,}", " ");
if anyone can confirm
0
you could use std::remove_if for that.
or check each character in a string, here is example:
https://code.sololearn.com/cAS2CykQpZQu/?ref=app
0
@Cain Eviatar, wait. Thanks in advance!