LastIndexOf is not a member of UiPath.Core.GenericValue


I have follwed this Topic : Understanding Substring & LastIndexOf() working , I got the following error :

Can someone help? Thanks in advance

@hsendel If Div is set to a Generic type, you would need to Convert to String in this way, Div.ToString and then perform String operations on it.


@supermanPunch, Yes diffinitly I solved it thanks : Div.ToString.Substring(Div.ToString.LastIndexOf(“Suggestion”))

1 Like

Tell me @supermanPunch, How to achieve this for the other side, means , I got the string part before this word and delete the remaining part.
Example : This is Just a Test to remove the last part of string after the keyword: “to”
Output : This is Just a Test
Thanks in advance

@hsendel You can use Regex to do this operation or if it’s really unique, you can just use the Split method sometimes :
That is the Keyword is appearing only once in the text :

Split(“your text”,“to”)(0)

Something like this also can be done using regex :

1 Like

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