for example we have this string:
- hello_my name_is_bob
and want to get only the “my Name” portion of the string, how could I get this simply with substring?
Also, the format in the example will always be the same so I just need to retrieve what is after the first underscore but before the 2nd underscore.
string.Splitwill do for this, no need to go intoSubstring:Or, in a one liner (though I find this less readable):