From OpenSCADAWiki
Enter a message name below to show all available translations.
Found 3 translations.
| Name | Current message text |
|---|---|
| h English (en) | * String: :; ''Properties:'' :* ''int length'' — string length. :; ''Functions:'' :* ''bool isEVal();'' — checks value to '''null'''-'''EVAL'''. :* ''bool isNaN( bool whole = true );'' — checks the string to Not A Number and in whole for ''whole''. :* ''string charAt( int symb, string type = "" );'' — extracts from the string the symbol ''symb'' for the ''type''. These types of the symbol are supported: ""-ASCII and raw one byte code, UTF-8, UTF-16, UTF-32. In the case of UTF-8, the symbol position ''symb'' is changed to the next symbol position due to length of this symbols type is variable one. :* ''int charCodeAt( int symb, string type = "" );'' — extracts from the string the symbol code ''symb'' for the ''type''. These types of the symbol are supported: ""-ASCII and raw one byte code, UTF-8, UTF-16, UTF-16LE, UTF-16BE, UTF-32, UTF-32LE, UTF-32BE. In the case of UTF-8, the symbol position ''symb'' is changed to the next symbol position due to length of this symbols type is variable one. :* ''string concat( string val1, string val2, ... );'' — returns a new string formed by joining the values ''val1'' etc. to the original one. :* ''int indexOf( string substr, int start = 0 );'' — returns the position of the required string ''substr'' in the original row from the position ''start''. If the initial position is not specified then the search starts from the beginning. If the search string is not found then "-1" is returned. :* ''int lastIndexOf( string substr, int start = {end} );'' — returns the position of the search string ''substr'' in the original one beginning from the position of ''start'' when searching from the end. If the initial position is not specified then the search begins from the end. If the search string is not found then "-1" is returned. :* ''int search( string pat, string flg = "" );'' — searches into the string by the pattern ''pat'' and pattern's flags ''flg''. Returns found substring position or "-1" for else. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> var rez = "Java123Script".search("script","i"); // rez = 7</syntaxhighlight> :* ''int search( RegExp pat );'' — searches into the string by the "RegExp" pattern ''pat''. Returns found substring position or "-1" for else. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> var rez = "Java123Script".search(new RegExp("script","i")); // rez = 7</syntaxhighlight> :* ''Array match( string pat, string flg = "" );'' — calls match for the string by the pattern ''pat'' and flags ''flg''. For the not global search returns matched substring (0) and subexpressions (>0) array, sets "index" attribute of the array to the substring position, sets the "input" attribute to the source string, sets the "err" attribute to the operation error code. For the global search just returns an array of the found items. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> var rez = "1 plus 2 plus 3".match("\\d+"); // rez = [1], index=0, input="1 plus 2 plus 3" var rez = "1 plus 2 plus 3".match("\\d+","g"); // rez = [1], [2], [3]</syntaxhighlight> :* ''Array match( TRegExp pat );'' — calls match for the string and "RegExp" pattern ''pat''. For the not global search returns matched substring (0) and subexpressions (>0) array, sets the "index" attribute of the array to substring position, sets the "input" attribute to the source string, sets the "err" attribute to the operation error code. For the global search just returns an array of the found items. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> var rez = "1 plus 2 plus 3".match(new RegExp("\\d+")); // rez = [1], index=0, input="1 plus 2 plus 3" var rez = "1 plus 2 plus 3".match(new RegExp("\\d+","g")); // rez = [1], [2], [3]</syntaxhighlight> :* ''string slice( int beg, int end ); string substring( int beg, int end );'' — returns the string extracted from the original one starting from the ''beg'' position and ending before the ''end'' (not included), numbering from zero. If the begin or end is negative, then the count is conducted from the end of the line. If the end is not specified, then the end is the end of the line. For example, the construction '''substring(-2)''' return two last symbols of the string. :* ''Array split( string sep, int limit = 0 );'' — returns the array of strings separated by ''sep'' with the ''limit'' of the number of elements (0 for no limit). :* ''Array split( RegExp pat, int limit = 0 );'' — returns the array of strings separated by the RegExp pattern ''pat'' with the ''limit'' of the number of elements (0 for no limit). <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> rez = "1,2, 3 , 4 ,5".split(new RegExp("\\s*,\\s*")); // rez = [1], [2], [3], [4], [5]</syntaxhighlight> :* ''string insert( int pos, string substr );'' — inserts the substring ''substr'' into this string's position ''pos''. :* ''string replace( int pos, int n, string str );'' — replaces substring into the position ''pos'' and length ''n'' to the string ''str''. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> rez = "Javascript".replace(4,3,"67"); // rez = "Java67ipt"</syntaxhighlight> :* ''string replace( string substr, string str );'' — replaces all the substrings ''substr'' to the string ''str''. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> rez = "123 321".replace("3","55"); // rez = "1255 5521"</syntaxhighlight> :* ''string replace( RegExp pat, string str );'' — replaces substrings by the pattern ''pat'' to the string ''str''. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> rez = "value = \"123\"".replace(new RegExp("\"([^\"]*)\"","g"),"``$1''")); // rez = "value = ``123''"</syntaxhighlight> :* ''real toReal();'' — converts this string to a real number. :* ''int toInt( int base = 0 );'' — converts this string to an integer number in accordance with ''base'' (from 2 to 36). If the base is 0, then the prefix will be considered a prefix for determining the base (123-decimal; 0123-octal; 0x123-hex). :* ''string {parse,parseEnd}( int pos, string sep = ".", int off = {0,{length}}, bool mergeSepSymb = false );'' — gets a token with the number ''pos'' from the string when separated by ''sep'' and from the offset ''off'' (stopping on the next token begin, end for ''parseEnd''). ''mergeSepSymb'' specifies of allowing of merging of the group of identical symbols to one separator. Result offset is returned back to ''off''. ''parseEnd()'' does the same but from the end. :* ''string parseLine( int pos, int off = 0 );'' — gets a line with the number ''pos'' from the string and from the offset ''off''. Result offset is returned back to ''off'' (stopping on the next token begin). :* ''string parsePath( int pos, int offCmptbl = 0, int off = 0 );'' — gets a path token with the number ''pos'' from the string and from the offset ''off'' (stopping on the next token begin) or ''offCmtbl'' (stopping on next symbol of the current token end — for compatibility). Result offset is returned back to ''off'' or ''offCmptbl''. :* ''string parsePathEnd( int pos, int off = {length} );'' — gets a path token with the number ''pos'' from the string end and from the offset ''off'' (stopping on the next token end). Result offset is returned back to ''off''. :* ''string path2sep( string sep = "." );'' — converts path into this string to separated by ''sep'' string. :* ''string trim( string cfg = " \n\t\r" );'' — trims the string at the begin and the end for the symbols ''cfg''. <section end=OBJ /> |
| h Russian (ru) | * Строка: :; ''Свойства:'' :* ''int length'' — длина строки. :;''Функции:'' :* ''bool isEVal();'' — проверяет значение на '''null'''-'''EVAL'''. :* ''bool isNaN( bool whole = true );'' — проверяет строку на не число, и в целом ''whole''. :* ''string charAt( int symb, string type = "" );'' — достаёт из строки символ под номером ''symb'' типа ''type''. Следующие типы символа поддерживаются: ""-ASCII и простой один байт, UTF-8, UTF-16, UTF-32. В случае с UTF-8, позиция символа ''symb'' меняется в позицию следующего символа поскольку длина символов этого типа переменная. :* ''int charCodeAt( int symb, string type = "" );'' — достаёт из строки код символа ''symb'' типа ''type''. Следующие типы символа поддерживаются: ""-ASCII и простой один байт, UTF-8, UTF-16, UTF-16LE, UTF-16BE, UTF-32, UTF-32LE, UTF-32BE. В случае с UTF-8, позиция символа ''symb'' меняется в позицию следующего символа поскольку длина символов этого типа переменная. :* ''string concat( string val1, string val2, ... );'' — возвращает новую строку, сформированную путём присоединения значений ''val1'' и т.д. к исходной. :* ''int indexOf( string substr, int start = 0 );'' — возвращает позицию искомой строки ''substr'' в исходной строке, начиная с позиции ''start''. Если исходная позиция не указана то поиск начинается с начала. Если искомой строки не найдено то возвращается "-1". :* ''int lastIndexOf( string substr, int start = {end} );'' — возвращает позицию искомой строки ''substr'' в исходной строке, начиная с позиции ''start'', при поиске с конца. Если исходная позиция не указана то поиск начинается с конца. Если искомой строки не найдено то возвращается "-1". :* ''int search( string pat, string flg = "" );'' — ищет в строке по шаблону ''pat'' и флагами шаблона ''flg''. Возвращает положение найденной подстроки иначе "-1". <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> var rez = "Java123Script".search("script","i"); // rez = 7</syntaxhighlight> :* ''int search( RegExp pat );'' — ищет в строке по шаблону "RegExp" ''pat''. Возвращает положение найденной подстроки иначе "-1". <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> var rez = "Java123Script".search(new RegExp("script","i")); // rez = 7</syntaxhighlight> :* ''Array match( string pat, string flg = "" );'' — ищет в строке по шаблону ''pat'' и флагами шаблона ''flg''. Возвращает массив с найденной подстрокой (0) и подвыражениями (>1). Атрибут "index" массива устанавливается в позицию найденной подстроки. Атрибут "input" устанавливается в исходную строку. Атрибут "err" устанавливается в код ошибки операции. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> var rez = "1 плюс 2 плюс 3".match("\\d+","g"); // rez = [1], [2], [3]</syntaxhighlight> :* ''Array match( TRegExp pat );'' — ищет в строке по шаблону "RegExp" ''pat''. Возвращает массив с найденной подстрокой (0) и подвыражениями (>1). Атрибут "index" массива устанавливается в позицию найденной подстроки. Атрибут "input" устанавливается в исходную строку. Атрибут "err" устанавливается в код ошибки операции. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> var rez = "1 плюс 2 плюс 3".match(new RegExp("\\d+","g")); // rez = [1], [2], [3]</syntaxhighlight> :* ''string slice( int beg, int end ); string substring( int beg, int end );'' — возвращает подстроку извлечённую из исходной, начиная с позиции ''beg'' и по ''end'' (не включая), нумерация с нуля. Если значение начала или конца отрицательно, то отсчёт ведётся с конца строки. Если конец не указан, то концом является конец строки. Например, конструкция '''substring(-2)''' вернет последние два символа строки. :* ''Array split( string sep, int limit );'' — возвращает массив элементов строки, разделённых ''sep'' и с ограничением количества элементов ''limit''. :* ''Array split( RegExp pat, int limit );'' — возвращает массив элементов строки, разделённых шаблоном "RegExp" ''pat'' и с ограничением количества элементов ''limit''. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> rez = "1,2, 3 , 4 ,5".split(new RegExp("\\s*,\\s*")); // rez = [1], [2], [3], [4], [5]</syntaxhighlight> :* ''string insert( int pos, string substr );'' — вставляет подстроку ''substr'' в позицию ''pos'' текущей строки. :* ''string replace( int pos, int n, string str );'' — заменяет подстроки с позиции ''pos'' и длиной ''n'' в текущей строке, на строку ''str''. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> rez = "Javascript".replace(4,3,"67"); // rez = "Java67ipt"</syntaxhighlight> :* ''string replace( string substr, string str );'' — заменяет все подстроки ''substr'' на строку ''str''. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> rez = "123 321".replace("3","55"); // rez = "1255 5521"</syntaxhighlight> :* ''string replace( RegExp pat, string str );'' — заменяет подстроки по шаблону ''pat'' на строку ''str''. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> rez = "value = \"123\"".replace(new RegExp("\"([^\"]*)\"","g"),"``$1''")); // rez = "value = ``123''"</syntaxhighlight> :* ''real toReal();'' — преобразует текущую строку в вещественное число. :* ''int toInt( int base = 10 );'' — преобразует текущую строку в целое число, в соответствии с основанием ''base'' (от 2 до 36). Если основание равно 0 то будет учитываться префиксная запись для определения основания (123-десятичное; 0123-восьмеричное; 0x123-шестнадцатеричное). :* ''string {parse,parseEnd}( int pos, string sep = ".", int off = {0,{length}}, bool mergeSepSymb = false );'' — выделяет из исходной строки элемент ''pos'', для разделителя элементов ''sep'' и от смещения ''off'' (останов на начале следующего токена, или конца для ''parseEnd''). ''mergeSepSymb'' определяет разрешение объединения группы одинаковых символов в один разделитель. Результирующее смещение помещается назад в ''off''. ''parseEnd()'' делает тоже самое, но с конца. :* ''string parseLine( int pos, int off = 0 );'' — выделяет строку с номером ''pos'' и от смещения ''off'' (останов на начале следующего токена). Результирующее смещение помещается назад в ''off''. :* ''string parsePath( int pos, int offCmptbl = 0, int off = 0 );'' — выделяет из исходного пути элемент ''pos'' и от смещения ''off'' (останов на начале следующего токена) или ''offCmtbl'' (останов на следующем символе конца текущего токена — для совместимости). Результирующее смещение помещается назад в ''off'' или ''offCmtbl''. :* ''string parsePathEnd( int pos, int off = {length} );'' — выделяет из конца строки исходного пути элемент ''pos'' и от смещения ''off'' (останов на конце следующего токена). Результирующее смещение помещается назад в ''off''. :* ''string path2sep( string sep = "." );'' — преобразует путь в текущей строке в строку с разделителем ''sep''. :* ''string trim( string cfg = " \n\t\r" );'' — обрезает строку с начала и конца, для символов ''cfg''. <section end=OBJ /> |
| h Ukrainian (uk) | * Рядок: :; ''Властивості:'' :* ''int length'' — довжина рядка. :; ''Функції:'' :* ''bool isEVal();'' — перевіряє значення на '''null'''-'''EVAL'''. :* ''bool isNaN( bool whole = true );'' — перевіряє рядок на не число, та загалом ''whole''. :* ''string charAt( int symb, string type = "" );'' — дістає із рядка символ за номером ''symb'' типу ''type''. Наступні типи символу підтримуються: ""-ASCII та простий одно байтовий, UTF-8, UTF-16, UTF-32. У випадку із UTF-8, позиція символу ''symb'' змінюється у позицію наступного символу оскільки довжина символів цього типу змінна. :* ''int charCodeAt( int symb, string type = "" );'' — дістає із рядка код символу ''symb'' типу ''type''. Наступні типи символу підтримуються: ""-ASCII та простий одно байтовий, UTF-8, UTF-16, UTF-16LE, UTF-16BE, UTF-32, UTF-32LE, UTF-32BE. У випадку із UTF-8, позиція символу ''symb'' змінюється у позицію наступного символу оскільки довжина символів цього типу змінна. :* ''string concat( string val1, string val2, ... );'' — повертає новий рядок, сформований шляхом приєднання значень ''val1'' та інші до початкового. :* ''int indexOf( string substr, int start = 0 );'' — повертає позицію пошукового рядка ''substr'' у вихідному рядку, починаючи з позиції ''start''. Якщо вихідна позиція не вказана то пошук починається з початку. Якщо шуканого рядка не знайдено то повертається "-1". :* ''int lastIndexOf( string substr, int start = {end} );'' — повертає позицію шуканого рядка ''substr'' у вихідному рядку починаючи з позиції ''start'', при пошуку з кінця. Якщо вихідна позиція не вказана то пошук починається з кінця. Якщо шуканого рядку не знайдено то повертається "-1". :* ''int search( string pat, string flg = "" );'' — шукає у рядку за шаблоном ''pat'' та ознаками шаблону ''flg''. Повертає положення знайденого рядку інакше "-1". <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> var rez = "Java123Script".search("script","i"); // rez = 7</syntaxhighlight> :* ''int search( RegExp pat );'' — шукає у рядку за шаблоном "RegExp" ''pat''. Повертає положення найденого підрядку інакше "-1". <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> var rez = "Java123Script".search(new RegExp("script","i")); // rez = 7</syntaxhighlight> :* ''Array match( string pat, string flg = "" );'' — шукає у рядку за шаблоном ''pat'' і ознаками шаблону ''flg''. Для неглобального пошуку повертає масив із знайденим підрядком (0) і підвиразами (>1), атрибут "index" масиву встановлюється у позицію знайденого підрядка, атрибут "input" встановлюється у початковий рядок, атрибут "err" встановлюється у код помилки операції. Для глобального пошуку просто повертає масив знайдених елементів. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> var rez = "1 plus 2 plus 3".match("\\d+"); // rez = [1], index=0, input="1 plus 2 plus 3" var rez = "1 плюс 2 плюс 3".match("\\d+","g"); // rez = [1], [2], [3]</syntaxhighlight> :* ''Array match( TRegExp pat );'' — шукає у рядку за шаблоном "RegExp" ''pat''. Для неглобального пошуку повертає масив зі знайденим підрядком (0) і підвиразами (>1), атрибут "index" масиву встановлюється у позицію знайденого підрядка, атрибут "input" встановлюється у початковий рядок, атрибут "err" встановлюється у код помилки операції. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> var rez = "1 plus 2 plus 3".match(new RegExp("\\d+")); // rez = [1], index=0, input="1 plus 2 plus 3" var rez = "1 плюс 2 плюс 3".match(new RegExp("\\d+","g")); // rez = [1], [2], [3]</syntaxhighlight> :* ''string slice( int beg, int end ); string substring( int beg, int end );'' — повертає підрядок вилучений з початкового, починаючи з позиції ''beg'' та до ''end'' (не включаючи), нумерація з нуля. Якщо значення початку або кінця негативне, то відлік ведеться з кінця рядку. Якщо кінець не вказано, то кінцем є кінець рядку. Наприклад, конструкція '''substring(-2)''' поверне останні два символи рядку. :* ''Array split( string sep, int limit = 0 );'' — повертає масив елементів рядку поділених ''sep'' та з обмеженням кількості елементів ''limit'' (0 без обмеження). :* ''Array split( RegExp pat, int limit = 0 );'' — повертає масив елементів рядку поділених шаблоном "RegExp" ''pat'' та з обмеженням кількості елементів ''limit'' (0 без обмеження). <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> rez = "1,2, 3 , 4 ,5".split(new RegExp("\\s*,\\s*")); // rez = [1], [2], [3], [4], [5]</syntaxhighlight> :* ''string insert( int pos, string substr );'' — вставляє підрядок ''substr'' у позицію ''pos'' поточного рядку. :* ''string replace( int pos, int n, string str );'' — замінює підрядок з позиції ''pos'' та довжиною ''n'' у поточному рядку, на рядок ''str''. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> rez = "Javascript".replace(4,3,"67"); // rez = "Java67ipt"</syntaxhighlight> :* ''string replace( string substr, string str );'' — замінює всі підрядки ''substr'' на рядок ''str''. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> rez = "123 321".replace("3","55"); // rez = "1255 5521"</syntaxhighlight> :* ''string replace( RegExp pat, string str );'' — замінює підрядок за шаблоном ''pat'' на рядок ''str''. <syntaxhighlight lang="JavaScript" style="margin-left: 30pt"> rez = "value = \"123\"".replace(new RegExp("\"([^\"]*)\"","g"),"``$1''")); // rez = "value = ``123''"</syntaxhighlight> :* ''real toReal();'' — перетворює поточной рядок у реальне число. :* ''int toInt( int base = 10 );'' — перетворює поточний рядок у ціле число, відповідно до основи ''base'' (від 2 до 36). Якщо основа дорівнює 0 тоді буде враховуватися префіксний запис для визначення основи (123-десяткове; 0123-вісімкове; 0x123-шістнадцяткове). :* ''string {parse,parseEnd}( int pos, string sep = ".", int off = {0,{length}}, bool mergeSepSymb = false );'' — виокремлює із вихідного рядку елемент ''pos'' для роздільника елементів ''sep'' та від зміщення ''off'' (зупинка на початку наступного токену, або кінці для ''parseEnd''). ''mergeSepSymb'' визначає дозвіл поєднання групи однакових символів у один роздільник. Результуюче зміщення поміщається назад до ''off''. ''parseEnd()'' робить те саме, але з кінця. :* ''string parseLine( int pos, int off = 0 );'' — виокремлює рядок з номером ''pos'' від зміщення ''off'' (зупинка на початку наступного токену). Результуюче зміщення поміщається назад до ''off''. :* ''string parsePath( int pos, int offCmptbl = 0, int off = 0 );'' — виділяє з початкового шляху елемент ''pos'' від зміщення ''off'' (зупинка на початку наступного токену) або ''offCmtbl'' (зупинка на наступному символі кінця поточного токену — для сумісності). Результуюче зміщення поміщається назад до ''off'' або ''offCmtbl''. :* ''string parsePathEnd( int pos, int off = {length} );'' — виділяє з кінця рядка початкового шляху елемент ''pos'' від зміщення ''off'' (зупинка на кінці наступного токену). Результуюче зміщення поміщається назад до ''off''. :* ''string path2sep( string sep = "." );'' — перетворює шлях у поточному рядку у рядок з розділювачем ''sep''. :* ''string trim( string cfg = " \n\t\r" );'' — обрізає рядок з початку та кінцю, для символів ''cfg''. <section end=OBJ /> |