Need Script Help w/String Compare

Unanswered Question
Jan 19th, 2009
User Badges:

I am a basic script writer and have not needed to use Java. I now have a need to find strings that are six characters (digits) long and begin with a "1". Using if VAR == "1....." doesn't work. Does anyone have a simple solution for this simple string compare? Do I need to use Java? Example please?

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
ronupcdef Mon, 01/19/2009 - 10:17
User Badges:

Found it! String methods under the If Step:

If String.StartsWith("1")

Jonathan Schulenberg Mon, 01/19/2009 - 17:48
User Badges:
  • Super Bronze, 10000 points or more
  • Cisco Designated VIP,

    2017 IP Telephony

Yep.

You can check length with the .Length(6) value.


((variable.StartsWith("1")) && (variable.Length(6)))

Actions

This Discussion