Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Is there a way to unstring a value that i have echoed? I need characters 8 thru 14 of a 17 character field

  • 1 reply
  • 1 has this problem
  • 3 views
  • Last reply by cor-el

more options

I am saving a value from a screen called our policy number. The entire policy number is in this format nn-nnn-nnnnnnn-nn. I need characters 8-14 to do a search in another screen. Is there a way that I can unstring this field for only those characters? Or is there a way that I can only save characters 8-14 of the value?

I am saving a value from a screen called our policy number. The entire policy number is in this format nn-nnn-nnnnnnn-nn. I need characters 8-14 to do a search in another screen. Is there a way that I can unstring this field for only those characters? Or is there a way that I can only save characters 8-14 of the value?

All Replies (1)

more options

Use a regular expression.

javascript:(function(){var t='nn-nnn-nnnnnnn-nn',p=prompt(t,t);alert(/..-...-(.......)-../.exec(p)?RegExp.$1:'(nothing)');})();