asp.net - how to insert newline in string in c# after some particular digit? -
asp.net - how to insert newline in string in c# after some particular digit? -
i programming code in have come in text in particular format only. i.e.
2 10 5 kdsfj ejkd kjdf 7 8 sdkj dsjklf ckjsd dksj
and on
but have come in info form text file having whole string
2 10 5 kdsfj ejkd kjdf7 8 sdkj dsjklf ckjsd dksj6 12 kjd ekjr fkjdr fdkj
but want suppy text given above format. bold letters saparable points. want programme can add together newline after character or space followed digit ?
how can ?
the reply going form of regex
regex.replace(inputstring, @"([a-za-z])(\d)", "$1" + environment.newline + "$2");
where input source line file, , pattern matches specific criteria. above replace end with:
2 10 5 kdsfj ejkd kjdf 7 8 sdkj dsjklf ckjsd dksj 6 12 kjd ekjr fkjdr fdkj
your additional comments clarified line breaks when joined previous character; although still not sure why 2 ends on own line?
c# asp.net string algorithm
Comments
Post a Comment