System Debug Reference Manual (32650-90888)
Chapter 10 455
System Debug Standard Functions
func strrpt
value is greater than the size of the source string, a zero result is returned.
Examples
$nmdebug > var source "Oh where oh where has my little dog gone"
$nmdebug > var searchstring "where"
$nmdebug > var first = strpos(source, searchstring)
$nmdebug > wl first
$4
Look for the string "where" in the source string and print the position where it was found.
$nmdebug > first = first + strlen(searchstring)
$nmdebug > var second = strpos(source, searchstring, first)
$nmdebug > wl second
$d
Look for the next occurrence of "where" in the source string and print the position where it
was found.
$nmdebug > second = second + strlen(searchstring)
$nmdebug > var third = strpos(source, searchstring, second)
$nmdebug > wl third
#0
Look for another occurrence of "where" in the source string. Since the search string is not
found, the value of zero (0) is returned.
Limitations, Restrictions
none
func strrpt
String repeat. Returns a string composed of repeated occurrences of a source string.
Syntax
strrpt (
source count
)
Formal Declaration
strrpt:str (
source
:str
count
:u32)
Parameters
source
The
source
string to repeat.
count
The number of times to repeat
source
.