Hi all,
I'm using vbscript, how do I find the hyphen character "-" in a string and place characters that follow in a new string?
Basically my computer names end with a room number
PC1-3 (room 3) , PC1-4 (room 4) etc
I'm using
Dim roomArray(2)
roomArray = Array("-1", "-2", "-3")
Dim item
For each item in roomArray
If instr(strComputerName, item)
..do something
End If
Next
but I'm getting false positives due to room -33 containing "-3" etc so if I locate "-" in the string and place the characters that follow into a string I can check against the full string rather than using instr.
Thanks for any help.