Need to Get the Values between the string &compare
I have this value in the string without any delimiter
"Amount$280.93Remaining$280.93StatusActiveAutomati c Overpayment RecoveryYesExplanationUserDefault,Facets,,UserExpe nse TypePlan Benefit"
I need to compare the dollarvalues between the text "amount" and Remaining" with the dollar value between "Remaining" and "Status"
Also, i need to verify if the text next to status is "Active" (it might have other values like inactive, deleted etc)
how could i do this in VB Scripting using QTP?
Re: Need to Get the Values between the string &compare
For StatusActive you can use InStr and check for its presence
For Amount and Remaining use below function
<font class="small">Code:</font><hr /><pre>
Public Function GetStrBetweenChar(ByVal Start, ByVal s_Text, ByVal s_StartChar, ByVal s_EndChar)
GetStrBetweenChar = ""
Dim i, Count, s_Char
i = InStr(Start, s_Text, s_StartChar)
If i <> 0 Then
i = i + Len(s_StartChar)
If s_EndChar <> "" Then
Count = InStr(i, s_Text, s_EndChar)
Count = Len(s_Text) + 1
If Count <> 0 Then
GetStrBetweenChar = Mid(s_Text, i, Count - i)
Msgbox GetStrBetweenChar(1,"Amount$280.93Remaining$280.93 Status", "Amount","Remaining")