Quantcast
Viewing all articles
Browse latest Browse all 224

Replace certain characters in part of string?

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