Hello,
This part of code return a Sign as boolean of string DMN expression, in Xojo Like operator is not available
Does any one knows how to do it under Xojo ?
Dim Sign As Boolean
Sign = (DMN Like "*S" Or DMN Like "*E")
Hello,
This part of code return a Sign as boolean of string DMN expression, in Xojo Like operator is not available
Does any one knows how to do it under Xojo ?
Dim Sign As Boolean
Sign = (DMN Like "*S" Or DMN Like "*E")
[code]Dim Sign As Boolean
dim RightChar as string
RightChar = right(DMN,1)
Sign = (RightChar = “S” Or RightChar = “E”)[/code]
You can also possibly use the RegEx class to match more advanced patterns…
It’s Ok, thank you Alwyn.
RegEx is the way to go as Alwyn pointed out.
But for this simple case I would prefer a small one line hack like:
Dim Sign As Boolean = InStr( “SE”, Right(DMN,1) ) > 0 // DMN sign
What make this easier and perhaps closer to VB is an InStrRegEx function like the one in my free M_String module.
dim sign as boolean = DMN.InStrRegEx_MTC( "[ES]\\z" ) <> 0