Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: widget.system Function




23 jun 2006 kl. 20.11 skrev Mike Blaguszewski:

I don't know of a built-in function for this, but it's easy to do with regular expressions. In your case, commandLoc.replace(/\n?$/, "") ought to do it. Or in general (untested):

function chomp(str)
{
	str.replace(/\r?\n?$/, ""); // classic Mac, Unix, or DOS endlines
}


It is also possible to use substring(..., ...)

str = "Hej!\n"
str1 = str.substring(0, str.length -1)
str2 = str.substring(0, str.indexOf('\n'))

Also this link might be helpful for other solutions:
http://docs.sun.com/source/816-6408-10/string.htm

/Mats

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden

References: 
 >widget.system Function (From: "Jesse Almanrode - JA Computing" <email@hidden>)
 >Re: widget.system Function (From: Mike Blaguszewski <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.