5.3 Операции со строками
Octave поддерживает широкий набор функций для обработки строк. Поскольку строка — это просто матрица, для простых манипуляций можно использовать стандартные операторы. В следующем примере показано, как заменить все пробельные символы символами подчеркивания.
quote = ...
"First things first, but not necessarily in that order";
quote( quote == " " ) = "_"
⇒ quote =
First_things_first,_but_not_necessarily_in_that_order Для более сложных операций, таких как поиск, замена и работа с регулярными выражениями общего назначения, в Octave предусмотрены следующие функции.
- Распространенные операции со строками
- Объединение строк
- Разбиение и объединение строк
- Поиск в строках
- Поиск и замена в строках
© 1996–2026 The Octave Project Developers
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
https://docs.octave.org/v9.4.0/String-Operations.html