TradeZoro
Notifications

Reference

Text (str)

Building and reading text.

str.contains(s, sub)

True if s contains sub.

Returns: true or false

ParameterType
sstring
substring

str.endswith(s, suffix)

True if s ends with suffix.

Returns: true or false

ParameterType
sstring
suffixstring

str.format(formatString, ...args)

Fills {0}, {1}, ... placeholders.

Returns: text

ParameterType
formatStringstring
argsany

str.length(s)

Number of characters.

Returns: a whole number

ParameterType
sstring

str.lower(s)

Lower case.

Returns: text

ParameterType
sstring

str.pos(s, sub)

Position of sub in s (na if absent).

Returns: a whole number

ParameterType
sstring
substring

str.repeat(s, repeat, separator="")

s repeated n times.

Returns: text

ParameterTypeNotes
sstring
repeatint
separatorstringDefault ""

str.replace(s, target, replacement, occurrence=0)

Replaces one occurrence of target.

Returns: text

ParameterTypeNotes
sstring
targetstring
replacementstring
occurrenceintDefault 0

str.replace_all(s, target, replacement)

Replaces every occurrence of target.

Returns: text

ParameterType
sstring
targetstring
replacementstring

str.split(s, separator)

Splits text into an array.

Returns: an array of string

ParameterType
sstring
separatorstring

str.startswith(s, prefix)

True if s starts with prefix.

Returns: true or false

ParameterType
sstring
prefixstring

str.substring(s, begin, end=na)

Part of s from begin up to (not including) end.

Returns: text

ParameterTypeNotes
sstring
beginint
endintDefault na

str.tonumber(s)

Parses text as a number (na if it is not one).

Returns: a number

ParameterType
sstring

str.tostring(value, format="")

Formats a value as text ("#.##", "0.00", "percent", "price", "volume").

Returns: text

ParameterTypeNotes
valueany
formatstringDefault ""

str.trim(s)

Removes spaces at both ends.

Returns: text

ParameterType
sstring

str.upper(s)

Upper case.

Returns: text

ParameterType
sstring

Education only. Not financial advice. Examples are teaching samples, not trading results.

Zscript is coming soon

The manual opens when Zscript launches.

Back to home