Hallo, I need to check if a string variable contains a second string, case sensitive and not. Is there any Diadem/VBS function to do this?
Here an example of what I mean:
If StrContain("pressure","pres") Then
ChnName = "Pressure"
ChnUnit = "bar"
Solved! Go to Solution.
You can use the InStr() command to see if a matching string is somewhere inside the larger string. You can use the LCase() or UCase() commands to cast the larger string to lower or upper case to ignore case differences. If you just wanted to check if the larger string started with the right matching string, you could use the Left() command.
ChName = "MYpreSSuRE" If InStr(LCase(ChName), "pres") Then ChName = "Pressure" ChUnit = "bar" End If MsgBox ChName
DIAdem Product Support Engineer