Back to questions
JuniorTheoryCommon
What does the program print (lines separated by spaces)?
Части = СтрРазделить("ручка,,ластик,", ",");
Сообщить(Части.Количество());
Части = СтрРазделить("ручка,,ластик,", ",", Ложь);
Сообщить(Части.Количество());
Сообщить(СтрСоединить(Части, "+"));4 2 ручка+ластик
- Expecting empty parts to be dropped by default: without the third parameter
СтрРазделитьkeeps them - Forgetting that a comma at the end also gives an empty part: an empty string is left after the last comma
- How do you remove the spaces around each part after splitting?
- How do you split a string by several separators at once?