Re: Reformatting a string
Re: Reformatting a string
- Subject: Re: Reformatting a string
- From: Michelle Steiner <email@hidden>
- Date: Fri, 27 Jan 2012 12:48:25 -0700
On Jan 27, 2012, at 11:07 AM, Angelo wrote: I need to take a long string string of letters numbers and colons and convert it to uppercase letters w/ no colons. a2:fh:2f:vv:i1:q1 needs to be A2FH2FVVI1Q1.
set x to "a2:fh:2f:vv:i1:q1" set text item delimiters to {":"} set x to text items of x set text item delimiters to {""} set x to x as string set y to {} repeat with i from 1 to count of x set z to ASCII number of character i of x if z > 96 and z < 123 then copy (ASCII character of (z - 32)) to end of y else copy character i of x to end of y end if end repeat set y to y as string
--> "A2FH2FVVI1Q1"
-- Michelle
-- "If you don't preach in my school I won't think in your church"
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden