Back to questions
JuniorTheoryCommon
What does the program print (lines separated by spaces)?
Артикул = "КТ-0042-С";
Сообщить(СтрДлина(Артикул));
Сообщить(СтрНайти(Артикул, "-"));
Сообщить(Сред(Артикул, 4, 4));9 3 0042
- Counting string positions from 0, like array indexes:
СтрНайтиandСредcount characters from 1 - Taking the third parameter of
Средfor the end position: it is the length of the substring
- What does
СтрНайтиreturn when the substring is absent? - How do you take the part of
Артикулafter the last hyphen?