Skip to main content

is it possible to make the screen read until the first comma it meets?

  • August 3, 2018
  • 1 reply
  • 0 views

i was wondering if it is possible to make the script read a sentence like

 

hello community, how are you

and then copy only the part until the first comma, where it says "hello community" 


#Rumba

1 reply

André Escudero

i was wondering if it is possible to make the script read a sentence like

 

hello community, how are you

and then copy only the part until the first comma, where it says "hello community" 


#Rumba

Hi,

that's possible ,look for the InStr  the Left command in the Rumba help

Syntax:
InStr([numbegin], string1, string2 [, comparecase])

Example:

position = InStr(1, sSentence, ",")            'Find the first comma

Then use Left with the found position

eg.
sMsg = Left(sSentence ,position-1)            'Returns the left most num characters of the parameter string