T
teo
I have a text.
Inside the text
the "hallo" word occurs five time.
I need to replace "hallo" with "hallo world".
Unfortunately I get this:
hallo world world world world world
Obviously I only need:
hallo world
How can avoid this?
------
Here the simple Replace method code
I'm currently using:
Dim myText as String = "Hallo to everyone; I'd like to say hallo
because saying hallo is a good thing; you also should
say hallo. Hallo guy."
Dim m As Match = Nothing
m = Regex.Match(myText, "hallo",
RegexOptions.Multiline Or RegexOptions.IgnoreCase)
Do While m.Success
myText = Replace(myText, m.Value, m.Value & " world")
m = m.NextMatch
Loop
Inside the text
the "hallo" word occurs five time.
I need to replace "hallo" with "hallo world".
Unfortunately I get this:
hallo world world world world world
Obviously I only need:
hallo world
How can avoid this?
------
Here the simple Replace method code
I'm currently using:
Dim myText as String = "Hallo to everyone; I'd like to say hallo
because saying hallo is a good thing; you also should
say hallo. Hallo guy."
Dim m As Match = Nothing
m = Regex.Match(myText, "hallo",
RegexOptions.Multiline Or RegexOptions.IgnoreCase)
Do While m.Success
myText = Replace(myText, m.Value, m.Value & " world")
m = m.NextMatch
Loop