Dears,
I have follwed this Topic : Understanding Substring & LastIndexOf() working , I got the following error :
Can someone help? Thanks in advance
Dears,
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â))
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 :
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.