Is there a means to get the index of the first non-whitespace character in a string (or more generally, the index of the first character matching a condition) in C# without
A string is of course an IEnumerable so you can use Linq:
string
IEnumerable
int offset = someString.TakeWhile(c => char.IsWhiteSpace(c)).Count();