Quantcast
Channel: CodeProject Latest postings for Regular Expressions
Viewing all articles
Browse latest Browse all 224

Replace certain characters in part of string?

$
0
0
Hello,

I have a question on regex: Is it possible to match for certain characters (and replace them) in only a part of a string? E. g.

str="I want to solve this problem"

I now want to match all spaces after the first occurence of the letter, say, "v". I know I can filter the whole part of the string after (and including) the first v with the regex "v.*", but how to match the spaces only in that part?

Thank you!

Viewing all articles
Browse latest Browse all 224

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>