set asocString to asocString's stringByReplacingOccurrencesOfString:"\\A(?:\\u2028|\\u2029|\\s)+|(?:\\u2028|\\u2029|\\s)+\\z" withString:"" options:(current application's NSRegularExpressionSearch) range:{0, asocString's |length|()} -- trim leading/trailing white space