@Word formula language function written as a javascript function?

Anyone have the @Word formula language function written as a javascript function?  Accepting the 3 parameters and returning the specified word...

I could really use this and cant figure out how to write it...
LVL 6
TheRookie32Asked:
Who is Participating?
 
CRAKConnect With a Mentor Commented:
Marilyn is right, but since you're after a 3 parameter equivalent:

function word(source, separator, element)
{
   return(source.split(separator)[element])
}

You may want to fiddle around with the value of <element>:
@Word returns elements 1 and up, javascript's split generates a 0-based array (1st element has index 0).
0
 
marilyngCommented:
var word = this.value.split(delimiter)
alert(word[0])

other variations, but I thought you would find this amusing.
0
 
TheRookie32Author Commented:
very nice, thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.