Get data based on index

Hi have a pdf and extracted string from the pdf is
“Lorem Ispum is a choke artist. It chokes! I think the only difference between me and the other placeholder text is that I’m more honest and my words are more beautiful. You could see there was text coming out of her eyes, text coming out of her wherever.”

I need to to get the word at index 36 which is ‘is’.

Hi @prateekjain1992,

You can use StringVariable.substring(36,2) to get tat value…

36 → starting index
2-> how many character required to view.

Let me know, if it works…

using this it will fetch using index as character/letters,
I need to get this as index as word.

Basically need the word at 36 index(36th word)

Hi @prateekjain1992,

Assuming that the string variable is str, then you should try the following:

a. Split by white space:

yourWordsArray [ ]= string.Split(new string[ ]{ " ”},StringSplitOptions.RemoveEmptyEntries);

b. Retrieve your word:

yourWord = yourWordsArray [ 36 ]

Best regards,
Marius

1 Like

Hi @prateekjain1992,

You can follow the same solution as @Marius_Puscasu suggested . But for optimized one, you can use below expression.

StringVar.split(" "c)(36)

You can get tat required value