Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions for 'replace' cheat sheet #1

Open
ostephens opened this issue May 7, 2019 · 2 comments
Open

Suggestions for 'replace' cheat sheet #1

ostephens opened this issue May 7, 2019 · 2 comments

Comments

@ostephens
Copy link

ostephens commented May 7, 2019

Just some suggestions - feel free to ignore or use as you see fit!

  • In the line Replace a single character (x) with several other characters (vwxyz) the GREL should be either value.replace(" & ", " and ") or value.replace("&", "and"). The current GREL would lead to extra spaces in the final result
  • In the line Remove more than one space suggest that the final column reads Removes more than three spaces as this is the result of the specific GREL used. Alternatively a regular expression replace could be used to replace any number of multiple spaces value.replace(/\s+/, "")
  • In the line Replace a single character (x) with several other characters (vwxyz) the GREL expression syntax has a trailing space after char
  • In the line Replace several characters (abcde) with several others (vwxyz) the GREL expression syntax has a trailing space after chars
  • In the last two lines demonstrating the use of regular expressions the formula in the GREL expression syntax column should use generic entries for the regular expression rather than the specifics (which are used in the following column). e.g. value.replace(/_regular expression_/,"newchars") and value.replace(/^regular expression/,"newchars")
@weaverbel
Copy link
Owner

Brilliant - thanks @ostephens - I have made all those changes. Do we want to add this at some stage to the LC files for the OR lesson or just leave it here?

@weaverbel
Copy link
Owner

I have also created some cheats for string split and other GREL - still refining those. @ostephens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants