How to extract characters from the middle of a string?

Richard Gaskin ambassador at
Thu Jul 8 10:12:46 CDT 2004

David Vaughan wrote:
> On 08/07/2004, at 8:47,  "J. Landman Gay" <jacque at> wrote:
>>> If I have a string containing 25 characters, how do I extract the 
>>> eight characters starting at position 5 in the string?
>>> [In BASIC this would be left$(5,8)  or some such.]
>>> This should be a simple thing to do but I can't figure it out and 
>>> can't figure out which dictionary item applies.
>> get char 5 to 12 of myString
> Nice to see that the fourth answer to the question finally got the 
> arithmetic part of the syntax right ;-)

It's a common human weakness to read problem statements like that and 
focus on the numbers more than the wording.  For that reason I would 
have included the word "inclusive" to draw attention to the wording, 
minimizing the potential for misreading.

  Richard Gaskin
  Fourth World Media Corporation
  Rev tools and more:

More information about the use-livecode mailing list