Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3798

Regex Issue

$
0
0

Hello All,

I have a string that can theoritically have “N” forward slashes in it. I want to remove only the last one.

Var strInput, strOutput As String
Var re as New RegEx

strInput = "Some text that I need for this example / And yet some more text I need /"
re.SearchPattern = "/$"
re.ReplacementPattern = ""
re.SearchStartPosition = strInput.Length - 3
strOutput = re.Replace(strInput)

In the output I see both the slashes still in the string.
Any idea where I am going awry?

14 posts - 7 participants

Read full topic


Viewing all articles
Browse latest Browse all 3798

Trending Articles