Re: text manipulation
Re: text manipulation
- Subject: Re: text manipulation
- From: Arthur J Knapp <email@hidden>
- Date: Tue, 05 Jun 2001 19:33:11 -0400
>
Date: Tue, 05 Jun 2001 12:47:08 EDT
>
From: email@hidden
>
Subject: text manipulation
>
I have a time string as follows "10:56 am". I have been trying to figure out a
>
way to change "am" to "a.m." or to "a.m", with no luck : ). Anybody have a
>
clue? Thanks.
set s to "10:56 am"
(text 1 thru 6 of s) & "a.m."
-- > "10:56 a.m."
(text 1 thru ((offset of "am" in s) - 1) of s) & "a.m."
-- > "10:56 a.m."
(text from word 1 to word -2 of s) & " a.m."
-- > "10:56 a.m."
set text item delimiters of AppleScript to {"am"}
set s to text items of s
set text item delimiters of AppleScript to {"a.m."}
set s to s as string
set text item delimiters of AppleScript to {""}
s
-- > "10:56 a.m."
Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden
Hey, check out:
<
http://developer.apple.com/techpubs/macos8/InterproCom/AppleScriptScripters
/AppleScriptLangGuide/>