Открыть меню
Открыть персональное меню
Вы не представились системе
Your IP address will be publicly visible if you make any edits.

Модуль:StringUtils/doc

Материал из wiki.iccup.org
Версия от 20:01, 3 сентября 2024; DarkMuse (обсуждение | вклад) (Новая страница: «Library for additional string functions in lua. ==API== {{ApiDocStart|String|link=Module:StringUtils}} {{ApiDoc|startsWith|params=str: string, start: string|description=Checks if a string starts with a certain substring.|returns=boolean}} {{ApiDoc|endsWith|params=str: string, ending: string|description=Checks if a string ends with a certain substring.|returns=boolean}} {{ApiDoc|split|params=inputstr: string, sep: string|description=Splits a string by a give...»)
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

Это страница документации Модуль:StringUtils.

Library for additional string functions in lua.

API[править код]

Программное имя: String


startsWith (str: string, start: string) → boolean

Checks if a string starts with a certain substring.


{{#iccupdb_datapoint:API_StringUtils/doc_startsWith

     |type=api
     |name=startsWith
     |information=
     |image=
     |date=
     |extradata={{#iccupdb_create_json:
       |description=Checks if a string starts with a certain substring.
       |params=str: string, start: string
       |returns=boolean
       |module=Module:StringUtils
     }}
   }}


endsWith (str: string, ending: string) → boolean

Checks if a string ends with a certain substring.


{{#iccupdb_datapoint:API_StringUtils/doc_endsWith

     |type=api
     |name=endsWith
     |information=
     |image=
     |date=
     |extradata={{#iccupdb_create_json:
       |description=Checks if a string ends with a certain substring.
       |params=str: string, ending: string
       |returns=boolean
       |module=Module:StringUtils
     }}
   }}


split (inputstr: string, sep: string) → table

Splits a string by a given seperator and returns the sections in a table.


{{#iccupdb_datapoint:API_StringUtils/doc_split

     |type=api
     |name=split
     |information=
     |image=
     |date=
     |extradata={{#iccupdb_create_json:
       |description=Splits a string by a given seperator and returns the sections in a table.
       |params=inputstr: string, sep: string
       |returns=table
       |module=Module:StringUtils
     }}
   }}


contains (str: string, match: string) → boolean

Checks if a string contains a certain substring.


{{#iccupdb_datapoint:API_StringUtils/doc_contains

     |type=api
     |name=contains
     |information=
     |image=
     |date=
     |extradata={{#iccupdb_create_json:
       |description=Checks if a string contains a certain substring.
       |params=str: string, match: string
       |returns=boolean
       |module=Module:StringUtils
     }}
   }}


trim (str: string) → boolean

Trims a string of whitespaces at the start and end.


{{#iccupdb_datapoint:API_StringUtils/doc_trim

     |type=api
     |name=trim
     |information=
     |image=
     |date=
     |extradata={{#iccupdb_create_json:
       |description=Trims a string of whitespaces at the start and end.
       |params=str: string
       |returns=boolean
       |module=Module:StringUtils
     }}
   }}


nilIfEmpty (str: string) → string or nil

If the string is empty this will return nil, else the string.


{{#iccupdb_datapoint:API_StringUtils/doc_nilIfEmpty

     |type=api
     |name=nilIfEmpty
     |information=
     |image=
     |date=
     |extradata={{#iccupdb_create_json:
       |description=If the string is empty this will return nil, else the string.
       |params=str: string
       |returns=string or nil
       |module=Module:StringUtils
     }}
   }}


isEmpty (str: string) → boolean

Checks if a string is empty.


{{#iccupdb_datapoint:API_StringUtils/doc_isEmpty

     |type=api
     |name=isEmpty
     |information=
     |image=
     |date=
     |extradata={{#iccupdb_create_json:
       |description=Checks if a string is empty.
       |params=str: string
       |returns=boolean
       |module=Module:StringUtils
     }}
   }}


isNotEmpty (str: string) → boolean

Checks if a string is not empty.


{{#iccupdb_datapoint:API_StringUtils/doc_isNotEmpty

     |type=api
     |name=isNotEmpty
     |information=
     |image=
     |date=
     |extradata={{#iccupdb_create_json:
       |description=Checks if a string is not empty.
       |params=str: string
       |returns=boolean
       |module=Module:StringUtils
     }}
   }}


explode (str: string, delimiter: string, index: number) → string

Splits the given string into pieces and then returns one of the pieces.


{{#iccupdb_datapoint:API_StringUtils/doc_explode

     |type=api
     |name=explode
     |information=
     |image=
     |date=
     |extradata={{#iccupdb_create_json:
       |description=Splits the given string into pieces and then returns one of the pieces.
       |params=str: string, delimiter: string, index: number
       |returns=string
       |module=Module:StringUtils
     }}
   }}


convertWikiListToHtmlList (str: string, delimiter: string) → string

transforms a wiki code list (* text) into a html list (ul&li tags)


{{#iccupdb_datapoint:API_StringUtils/doc_convertWikiListToHtmlList

     |type=api
     |name=convertWikiListToHtmlList
     |information=
     |image=
     |date=
     |extradata={{#iccupdb_create_json:
       |description=transforms a wiki code list (* text) into a html list (ul&li tags)
       |params=str: string, delimiter: string
       |returns=string
       |module=Module:StringUtils
     }}
   }}


Посмотрите всю нашу документацию iCCup здесь.


Содержание