Number of last occurance for "find text position" function

Can anyone help me?
How i schould get number of last occurance of finded word in “find text position”?
I’m using it in case with telegram web app.

For example, i have many messages in chat, just like:
Start 123
Start word

I want find text position of last massege what include “start”
Number of occurence is not fixed, it’s dynamic, but i need only last occurence. In this example we have 3 times. So, in all i want have an integer=3.

1 Like

Hi @Nikolay_Burykin,

You can use the string function to achieve this:
str = "Start
Start 123
Start word"
lstIndex = str.LastIndexOf("Start");

To print the remaining text after the last “Start”:

1 Like


you can split the whole string and store it in array. last index of the array will be your required text.Replace the “start” into “” in last array index to get the output.

str=" Start
Start 123
Start word"

split string:

1 Like

I think it’s help me in another case, thx.
But in this case it’s return index of last character of word, that we find, not number of occurence.
In this case i want get int=3

i’m not shure, what i understand how get an integer with number of occurence from this array
Can you ask one more example, please?

This will return the text from the strText string considering that you can have some letters in uppercase.
So if your string is “Start 123, start kjkj Start: ok” you will get “Start: ok”



to get the count of array:


Please use regular expression to get the count of occurrences:


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.