How to erase an white space from a string ? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

How to erase an white space from a string ?

25th Nov 2017, 5:26 PM
Ștefan Cucu
Ștefan Cucu - avatar
3 Antworten
+ 3
there are a number of ways. There is a simple library function you can use called isspace () that checks for this. or you can use strcmp(stuff, " "). It returns 0 if they're equal. Then proceed to modify the array. Don't forget #includes! :)
25th Nov 2017, 5:37 PM
Sapphire
0
A side note, I would use memmove() over strcpy ()
25th Nov 2017, 5:40 PM
Sapphire
0
Can you please write some code as an example ?
25th Nov 2017, 5:54 PM
Ștefan Cucu
Ștefan Cucu - avatar