Mikroelektronika MIKROE-442 Datenbogen
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
681
rtrim
Prototype
sub procedure rtrim(dim byref astring as string)
Description The procedure trims the trailing spaces of the string.
Example
Example
txt = “mikroE “
rtrim(txt) ‘ trims the trailing 2 spaces of the ‘txt’ string and adds
terminating null character to the result
strappendpre
Prototype
sub procedure strappendpre(dim letter as char, dim byref s1 as string)
Description The procedure appends character at the beginning of the string.
Example
Example
txt = “ikroE”
strappendpre(“m”,txt) ‘ adds letter ‘m’ at the beginning of the ‘txt’
string
strappendsuf
Prototype
sub procedure strappendsuf(dim byref s1 as string, dim letter as char)
Description The procedure appends character at the end of the string.
Example
Example
txt = “mikro”
strappendsuf(“E”,txt) ‘ adds letter ‘E’ at the end of the ‘txt’ string
length
Prototype
sub function length(dim byref s as string) as word
Description The function returns length of passed string.
Example
Example
txt = “mikroE”
res = length(txt) ‘ calculates and returns the length of the ‘txt’ string