Interview question asked recently

StrVar= “my city name is Jodhpur “
Extract the word name from above string?

If you split string it give you words.
image

Hi,

Hope the following helps you.

StrVar.Substring(8,4)

img20211108-2

FYI, If you want to get city name after "my city name is ", the following works.

System.Text.RegularExpressions.Regex.Match(StrVar,"(?<=my city name is ).*").Value

Regards,

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