What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » startsWith() and endsWith()

startsWith() and endsWith()
Author: Message:
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: startsWith() and endsWith()
I normally am a person who uses regular expressions all over the place (it is my job after all) but in this case I would highly recommend not doing it as it is a much slower option.  Instead I would use the following

JScript code:
function startsWithToken(orig)
{
    return (orig.charAt(0) == "$" && orig.charAt(1) == "$");
}
function endsWithToken(orig)
{
    var len = orig.length;
    return (orig.charAt(len-2) == "$" && orig.charAt(len-1) == "$");
}


I am not sure if a single character string is equivalent to a character, that is why I didn't use "===".
[Image: markee.png]
06-18-2009 07:46 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
startsWith() and endsWith() - by Flippy on 06-17-2009 at 04:59 PM
RE: startsWith() and endsWith() - by Mnjul on 06-17-2009 at 05:28 PM
RE: RE: startsWith() and endsWith() - by Flippy on 06-17-2009 at 06:26 PM
RE: startsWith() and endsWith() - by CookieRevised on 06-17-2009 at 07:19 PM
RE: startsWith() and endsWith() - by Flippy on 06-17-2009 at 07:46 PM
RE: startsWith() and endsWith() - by CookieRevised on 06-17-2009 at 07:52 PM
RE: startsWith() and endsWith() - by markee on 06-18-2009 at 07:46 AM
RE: startsWith() and endsWith() - by CookieRevised on 09-22-2009 at 08:15 AM
RE: startsWith() and endsWith() - by brooooof on 09-27-2009 at 06:43 AM
RE: startsWith() and endsWith() - by jerone on 10-08-2009 at 11:40 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On