Shorten the value
I have a field where I get the value using this code:
LoginUser = Browser("eVoucher 7_4").Page("eVoucher 7").WebElement("Welcome, Patrick Jones").GetROProperty("innertext")
Value = Welcome, Patrick Jones (Court Staff) Logout
I would like to shorten the value to equal " Court Staff"
only thing is the value between the "( )" could be different , Judge, Attorney, etc
Can anyone help?
You may also use regular expression.
Set objRE = New RegExp
.Pattern = "Welcome.*\((.*)\)+"
.IgnoreCase = True
.Global = False
x = "Welcome, Patrick Jones (Court Staff) Logout"
Set objMatch = objRE.Execute( x )
' We should get only 1 match since the Global property is FALSE
txt = "empty"
If objMatch.Count = 1 Then
txt = objMatch.Item(0).submatches(0)