Домой Классы Статические функции Перечисления (ENUM) Структуры (STRUCTURE)

{String_functions|_common}


(включая защищенные члены)

CLASS {String_functions|_common} , ABSTRACT, NATIVE, BYTES, BITWISE, UNTESTED, RECURSIVE :



Функции для работы со строками. Есть так же встроенные функции Len и Find, которые так же могут пригодиться.


IMPORT : {NATIVE_String_functions} .



--------------------------------------------------- 'начало / конец строки'

                  

FUNCTION Add_trail|ing ( STR S|ource_str , STR Trail|ing_str ) ==> STR



FUNCTION Trailing_slash ( STR P|ath_input ) ==> STR



FUN Path_sep|arator || Path_delimiter ==> STR , NATIVE



FUN Remove_trailing ( STR S|ource_str , STR T|o_remove ) ==> STR



FUN Remove_ending ( STR S|ource_str , STR T|o_remove ) ==> STR



FUN Remove_starting ( STR S|ource_string , STR T|o_remove ) ==> STR



FUN Exclude|_substring (
     
STR S|tring_wher_exclude ,
     
STR W|hat_to_exclude ) ==> STR



FUN Remove_all (
     
STR S|tring_wher_exclude ,
     
STR W|hat_to_exclude ) ==> STR , INLINE



FUNCTION Starting|_with_string (
     
STR S|ource_s ,
     
STR B|egin_str ) ==> BOOL



FUNCTION Ending|_with_string || Ended|_by_string (
     
STR S|ource_s ,
     
STR E|nding_str ) ==> BOOL



FUNCTION Find_last (
     
STR S|tring_where_find ,
     
STR W|hat_find ) ==> INT



FUNCTION Find_from (
     
STR S|tring_where_find ,
     
INT From|_index ,
     
STR W|hat_find ) ==> INT



FUN Find_pos|ition_or_return_length (
     
STR S|tring_search_in ,
     
STR Patt|ern_to_search ) ==> INT



FUNCTION if || If|_condition_then_string (
     
BOOL Cond|ition ,
     
STR S|tring_to_return ) ==> STR , PUBLIC



FUN if_else || If_else || If_Else|_condition_then_string (
     
BOOL Cond|ition ,
     
STR S|tring_to_return ,
     
STR E|lse_variant ) ==> STR , PUBLIC



FUN if_debug || If_debug ( STR S|tring_to_return ) ==> STR , PUBLIC



FUNCTION Like|_pattern (
     
STR S1|tring_1 ,
     
STR S2|_pattern ) ==> BOOL , CALLBACK



FUNCTION fast_like (
     
STR S1|tring_1 ,
     
STR S2|_pattern ,
     
INT Pos1|ition ,
     
INT Pos2|ition ) ==> BOOL , RECURSIVE



-------------------------------------------- 'кодировка символов как чисел'

  

FUNCTION Char|acter ( INT I|nteger_code ) ==> STR , NATIVE



FUNCTION Ord|er_of_char ( STR Ch|aracter ) ==> INT , NATIVE



------------------------------------------------------------ 'регистр букв'

  

FUNCTION Upper|_case ( STR S|ource_str ) ==> STR , NATIVE



FUNCTION Lower|_case ( STR S|ource_str ) ==> STR , NATIVE



------------------------------------------------------------------ 'arrays'

  

FUNCTION Contains|_string_in_array (
     
STR A|rray_of_strings [*] ,
     
STR Value|_string ,
     
BOOL Ignore_case|_of_letters ) ==> BOOL



FUNCTION Index_of (
     
STR A|rray_of_strings [*] ,
     
STR Value|_string ,
     
BOOL Ignore_case|_of_letters ) ==> INT



-------------------------------------------- 'обрезка не печатных символов'

     

FUNCTION Trim|_both_sides ( STR S|ource_str ) ==> STR



FUNCTION TrimR|ight ( STR S|ource_str ) ==> STR



FUNCTION TrimL|eft ( STR S|ource_str ) ==> STR



FUN RTrim|_right ( STR S|ource_string ) ==> STR



FUN LTrim|_left ( STR S|ource_string ) ==> STR



--------------------------------------------- 'деление строки разделителем'

     

FUN Split|_string (
     
STR Dest|ination_array [] ,
     
STR S|tring_to_split ,
     
STR By|_pattern )



FUN Split_to|_array_of_strings (
     
STR S|ource_string ,
     
STR Dest|ination_array [] ,
     
STR By|_pattern )



FUN Merge|_strings (
     
STR,INT,REAL S|trings_to_merge [*] ,
     
STR Sep|arator ) ==> STR



FUN do_merge|_strings (
     
STR,INT,REAL S|trings_to_merge [*] ,
     
STR Sep|arator ,
     
INT L|evel_max_31 ) ==> STR , RECURSIVE



FUN Count_char|s ( STR S|tring_in , STR C|har_to_count ) ==> INT



-------------------------------------------------------- 'замена подстроки'

           

FUN Replace|_symbol (
     
STR S|ource_string ,
     
STR F|rom_symbol ,
     
STR T|o_symbol ) ==> STR



FUN Replace_last|_symbol (
     
STR S|ource_string ,
     
STR F|rom_symbol ,
     
STR T|o_symbol ) ==> STR



FUN Replace_no_case|_symbol (
     
STR S|ource_string ,
     
STR F|rom_symbol_no_case ,
     
STR T|o_symbol ) ==> STR



FUN Replace_no_case_last|_symbol (
     
STR S|ource_string ,
     
STR F|rom_symbol_no_case ,
     
STR T|o_symbol ) ==> STR



FUN Replace_all (
     
STR S|ource_string ,
     
STR F|rom_symbol ,
     
STR T|o_symbol ) ==> STR



FUN Replace_all_no_case|_in_F (
     
STR S|ource_string ,
     
STR F|rom_symbol ,
     
STR T|o_symbol ) ==> STR



FUNCTION Repeat|_string (
     
STR What|_to_repeat ,
     
INT Count|_spaces ) ==> STR



FUN do_repeat_string (
     
STR What|_to_repeat ,
     
INT Count|_spaces ) ==> STR , NATIVE



FUN Hex|_from_integer (
     
INT N|umber_to_hex ,
     
INT Min|imum_digits ) ==> STR



FUN From_hex ( STR S|tring_start_from_hex_number ) ==> INT



FUN S0|_zero_leading_number (
     
INT N|umber_to_string ,
     
INT Min|imum_digits ) ==> STR



--------------------------------------------------------------- 'кодировка'

                     

ENUMERATION {encoding} :

        'DEFAULT|_ENCODING' ,

        'ASCII|_ENCODING' ,

        'UTF8|_ENCODING' ,

        'UTF16|_UNICODE' ,

        'UTF16_BIG|_ENDIAN' ,

        'UTF7|_ENCODING' ,

        'UTF32|_ENCODING' ,

        'UTF32_BIG|_ENDIAN' .



FUN Inner_encoding|_of_strings_in_the_environment ==> {encoding}



FUN Encoding_supported (
     
{String_functions}.{encoding} E|ncoding ) ==> BOOL



FUN Bytes_to_ascii (
     
BYTE B|uffer_bytes [*] ) ==> STR , NATIVE



FUN Bytes_to_utf8 (
     
BYTE B|uffer_bytes [*] ) ==> STR , NATIVE



FUN Bytes_to_utf7 (
     
BYTE B|uffer_bytes [*] ) ==> STR , NATIVE



FUN Bytes_to_utf16 (
     
BYTE B|uffer_bytes [*] ) ==> STR , NATIVE



FUN Bytes_to_utf16_big (
     
BYTE B|uffer_bytes [*] ) ==> STR , NATIVE



FUN Bytes_to_utf32 (
     
BYTE B|uffer_bytes [*] ) ==> STR , NATIVE



FUN Bytes_to_utf32_big (
     
BYTE B|uffer_bytes [*] ) ==> STR , NATIVE



FUN Bytes_from_default ( BYTE D|estination [] , STR S|ource_string )



FUN Bytes_from_ascii (
     
BYTE D|estination [] ,
     
STR S|ource_string ) , NATIVE



FUN Bytes_from_utf8 (
     
BYTE D|estination [] ,
     
STR S|ource_string ) , NATIVE



FUN Bytes_from_utf7 (
     
BYTE D|estination [] ,
     
STR S|ource_string ) , NATIVE



FUN Bytes_from_utf16 (
     
BYTE D|estination [] ,
     
STR S|ource_string ) , NATIVE



FUN Bytes_from_utf16_big_endian (
     
BYTE D|estination [] ,
     
STR S|ource_string ) , NATIVE



FUN Bytes_from_utf32 (
     
BYTE D|estination [] ,
     
STR S|ource_string ) , NATIVE



FUN Bytes_from_utf32_big_endian (
     
BYTE D|estination [] ,
     
STR S|ource_string ) , NATIVE



FUN Unicode16_to_Ansi (
     
STR U|nicode_string ,
     
BYTE A|nsi_string_bytes [] ) , NATIVE



FUN Oem_to_string ( STR Oem|_encoded_string ) ==> STR



FUN do_Oem_to_string ( STR S|Oem_ansi [] ) , NATIVE


END