c# - Get index of first detected space after a certain index in a string -
in string format (mostly replace chars different symbols rendering test on ui), have detect % , skip chars util first space % char , has repeated instances in string.
e.g. abcd%1$s efgh %2$d ijkl
.in string, have index of % , find index of first space that. basically, have skip %1$s
& %2$d
sort of formatting placeholders. hope, not putting in complex way here.
you can pretty easily, grab index if first percent sign , leverage index find first space there:
var start = mystring.indexof("%"); var spaceindex = mystring.indexof(" ", start)
of course value of mystring string represented in question.
Comments
Post a Comment