We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

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 பதிலளி
  • 1 இந்த பிரச்சனை உள்ளது
  • 3 views
  • Last reply by cor-el

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)

Use a regular expression.

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