Groups
Conversations
All groups and messages
Send feedback to Google
Help
Training
Sign in
Groups
World's Simplest Code Generator
Conversations
About
How to reverse a string value
7 views
Skip to first unread message
secretGeek
unread,
Sep 16, 2009, 10:37:13 PM
9/16/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to World's Simplest Code Generator
Handy little trick i worked out yesterday:
If you want to reverse a term in WSCG, you can use this pattern:
<% $0.split("").reverse().join("") %>
input:
Hello
becomes
olleH
This can also be useful for grabbing text off the end of a term.
Say if you have messages like this:
Fred 15
Fred smith 17
Jack 12
then reversing it and grabbing the first element
<% $0.split("").reverse().join("").split(" ")[0].split("").reverse
().join("") %>
will give you:
15
17
12
Reply all
Reply to author
Forward
0 new messages