String manipulation methods: message.Split("."c).First.ToString.Substring(message.LastIndexOf("author"))

I am a beginner in the RPA Developer course. can anyone explain the this message.Split("."c).First.ToString.Substring(message.LastIndexOf(“author”))

Hi ,
Can you please specify the message also here . It would be easy to say so.

yes mam

messege=“You searched for author Mark Twain. His books can be found in the following stores: Bookland,Classics bookstore.”

Hi @Vrushali_Gave,

  1. The first one is Split it by “.” and the c in it.

https://forum.uipath.com/t/split-c-what-is-c/1581

  1. message.Split("."c).First This take only the First index in the Array.

Output:You searched for author Mark Twain

  1. message.LastIndexOf(“author”).toString

Output 17 (It is the index of start of author )

  1. message.Split("."c).First.ToString.Substring(message.LastIndexOf(“author”)) It takes the

Output Get the Substring from index 17

Total Output Is "author Mark Twain"

5 Likes

I’m not so good at explaining . Hope this works.

Thank you so much mam

yes its worked

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