Remove characters into a string from determined characters

Hi there !

I would like to remove from a string a part which always begins by “of”.

Here some examples / My raw data :
“1 of 1111”
“2 of 1000”
“99 of 9999”

I would like these results :
1
2
99

So how can i remove any characters after “of” occured ?

Thanks a lot !

Hi @Simon_RUMEL_SIXDENIE,

Use the below code.

Assign String2= String1.substring(1, string1.indexof(“of”)-1)

Hi Vivek,
Small change in your reply
Assign String2= String1.substring(0, string1.indexof(“of”)-1)