# \[MX\] String From Array Question

**URL:** <https://forum.kirupa.com/t/mx-string-from-array-question/53344>\
**Category:** flash\
**Created:** [June 2, 2004, 8:42pm UTC](https://forum.kirupa.com/t/mx-string-from-array-question/53344 "2004-06-02T20:42:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![foochuck](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@foochuck](https://forum.kirupa.com/u/foochuck)\
**Post date:** [June 2, 2004, 8:42pm UTC](https://forum.kirupa.com/t/mx-string-from-array-question/53344/1 "2004-06-02T20:42:29Z")

</div>

If I have an Array such as this:

```auto

var myArray = new Array("home.swf","contact.swf","search.swf");

```

And I use this

```auto

var myString = myArray[0];

```

How can I cut off the last 4 characters of that string - “.swf” - (I think this can be done if I start with a negative -1 )

So I end up with

```auto

var myString = "home";

```

instead of

```auto

var myString = "home.swf";

```

Thanks…
