Hello,
I am wanting to use the #fileDescription to name procedures in my MVC template; however, I need the ability to "scan" and "replace" unnecessary characters. Is there a way to do this that I am not aware of currently?
For example, our file description looks like this: SO-Shipments-Header Level Tax Info
I want to squeeze out the hyphens and spaces.
Thanks,
Sheri McPherson
command to string search?
-
- New User
- Posts: 7
- Joined: Mon Jun 05, 2017 1:03 pm
- First Name: sheri
- Last Name: mcpherson
- Company Name: winsupply
- Contact:
- matt.denninghoff
- Profound Logic Staff Member
- Posts: 115
- Joined: Wed Feb 10, 2016 3:53 pm
- First Name: Matthew
- Last Name: Denninghoff
- Company Name: Profound Logic Software
- State / Province: Ohio
- Country: United States
- Contact:
Re: command to string search?
Yes, there is a relatively new template directive, #eval, which allows you to use javascript in the pre-processing phase. So if you were to use the JavaScript replace function, then you can remove spaces and dashes with this:
Then the resulting file description would be: SOShipmentsHeaderLevelTaxInfo
The form of replace above uses a Regular Expression with the "global" flag, to match and replace all instances of either "-" or " ". #eval came out with Profound UI version 5.7.0.
Code: Select all
#eval("#fileDescription".replace(/[- ]/g,""))
The form of replace above uses a Regular Expression with the "global" flag, to match and replace all instances of either "-" or " ". #eval came out with Profound UI version 5.7.0.
-
- New User
- Posts: 7
- Joined: Mon Jun 05, 2017 1:03 pm
- First Name: sheri
- Last Name: mcpherson
- Company Name: winsupply
- Contact:
Re: command to string search?
Matt,
Thank you very much for letting me know! I have very limited experience with JavaScript am a RPG programmer trying to use Jumpstart. Your help is greatly appreciated.
Thank you very much for letting me know! I have very limited experience with JavaScript am a RPG programmer trying to use Jumpstart. Your help is greatly appreciated.
Who is online
Users browsing this forum: No registered users and 2 guests