Split and display

hello frnds

I want to store a split string in an array and then display it one by
one.

Eg:- Say suppose my db value is “My email id is [email protected]” then i want
that only the email should be displayed so how will I do it pls reply

thanks

Dhaval P.

Hi,

Dhaval P. wrote:

I want to store a split string in an array and then display it one by
one.

“my string”.split
=> [“my”, “string”]

Eg:- Say suppose my db value is “My email id is [email protected]” then i want
that only the email should be displayed so how will I do it pls reply

You can use a regual expression for this.

“My email id is [email protected]”.match(/\S+@\S+.\S+/)[0]
=> “[email protected]

Of course this regular expression needs improvement because not all
characters are valid.

Lutz

thanx a lot Lutz for your quick reply.