How to make the line replace all spaces with pluses? Preferably using Replace.
|
2 answers
var str = "sdfa dsfas sdfasd".Replace(" ", "+"); - And for sure. Thanks, I'm stupid. - Svyatoslav
|
Another option for Regex.Replace - replacing a sequence of spaces with +
Regex rgx = new Regex("\\s+"); string result = rgx.Replace("Это какой-то тест с пробелами: ", "+"); - oneToo hard. - Pavel S. Zaitsau
|