How to calculate the index length from 1 word to another word in a string

hey guys

Let’s say there’s a long sentence

I need to find the index length between a particular word to another word

& the length or the string between these2 words also changes, so can’t count it directly

So please help

Thanks :slight_smile:

Use IndexOf to get the position of each, then subtract.

1 Like

@Jiban_Kumar_Das_TcM

I have a string D1168+89

Here I want to know at which position character “+” is present in the above string.

Here as we can se it is present at 6 th position

For this you can try IndexOf methos as the following? “D1168+89”.IndexOf(“+”) This returns 5 as zero-based index. Regards,

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