LEFTOF


String function LEFTOF


10
20  LEFTOF (s1, s2)
30
Returns the left part of s1 at the position of the first occurrence of the string s2 into string s1.


See examples


If there is insufficient information on this page and you wish learn more about LEFTOF, please send an email to smallbasic@gmail.com. You can help to improve information about LEFTOF by submitting an article using the comments link below. Note, an offline language reference text file is now avialable – see the Download section.

Comments


s1 = "small*SMALL*BASIC*basic"
s2 = "*"

Color 15
? "s1 parameter is: "; s1
?
? "s2 parameter is: "; s2
?
?
Color 7
? "Leftof(s1, s2) = "; Leftof(s1, s2)
? "Left(s1, Instr(s1, s2) - 1) = "; Left(s1, Instr(s1, s2) - 1)
?
? "Leftoflast(s1, s2) = "; Leftoflast(s1, s2)
? "Left(s1, Rinstr(s1, s2) - 1) = "; Left(s1, Rinstr(s1, s2) - 1)
?
? "Rightof(s1, s2) = "; Rightof(s1, s2)
? "Right(s1, Rinstr(s1, s2) - 1) = "; Right(s1, Rinstr(s1, s2) - 1)
?
? "Rightoflast(s1, s2) = "; Rightoflast(s1, s2)
? "Right(s1, Instr(s1, s2) - 1) = "; Right(s1, Instr(s1, s2) - 1)
?
?
? "Leftof(s1, s2) + Rightoflast(s1, s2): "; Leftof(s1, s2) + Rightoflast(s1, s2)
Pause