Jump to content

Remove Roman Numerials


AngelBenitez

Recommended Posts

This is another one you could Google for, something like "javascript strip roman numerals."

Assuming that the Roman numerals are at the end of the string, and that they're numbers less than 90, then it's pretty simple:

var s = "Digtal Media Specialist III"; // field value etc.
return s.replace(/\s*[IVXL]+$/, '');
Link to comment
Share on other sites

51 minutes ago, AngelBenitez said:

Hello @Dan Korn; thank you for your help. If the value is being pulled from an Excel sheet, what would be the rule to remove the variable in the Excel sheet?

You would just call the Field function to grab the value from the named data field, for Excel or any other input data format, something like this:

var s = Field("Title");
return s.replace(/\s*[IVXL]+$/, '');

Or if it's from an XDF, something like:

var s = XDF.GetFieldValue(recordNum, "Title");
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...