# Stripping Strings of Letters

**URL:** <https://forum.kirupa.com/t/stripping-strings-of-letters/19350>\
**Category:** flash\
**Created:** [April 27, 2003, 1:44am UTC](https://forum.kirupa.com/t/stripping-strings-of-letters/19350 "2003-04-27T01:44:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamapathy](https://avatars.discourse-cdn.com/v4/letter/i/ac8455/32.png) [@iamapathy](https://forum.kirupa.com/u/iamapathy)\
**Post date:** [April 27, 2003, 1:44am UTC](https://forum.kirupa.com/t/stripping-strings-of-letters/19350/1 "2003-04-27T01:44:02Z")

</div>

Is there a way to take all the letters out of a string and then use it as a integer?

If that is not possible, is there a way to take the first three letters off a string variable?

i.e. make [COLOR=crimson]myVariable=‘pic1’[/COLOR] into [COLOR=crimson]myVariable = ‘1’[/COLOR]

Yes? no?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 27, 2003, 2:24am UTC](https://forum.kirupa.com/t/stripping-strings-of-letters/19350/2 "2003-04-27T02:24:35Z")

</div>

```auto
myVariable = number(myVariable.charAt(3))

```

would do it 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 27, 2003, 2:40am UTC](https://forum.kirupa.com/t/stripping-strings-of-letters/19350/3 "2003-04-27T02:40:13Z")

</div>

also see:  
[http://proto.layer51.com/d.aspx?f=546](http://proto.layer51.com/d.aspx?f=546)  
😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 27, 2003, 2:43am UTC](https://forum.kirupa.com/t/stripping-strings-of-letters/19350/4 "2003-04-27T02:43:12Z")

</div>

nice protos you got there sen 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 27, 2003, 5:12am UTC](https://forum.kirupa.com/t/stripping-strings-of-letters/19350/5 "2003-04-27T05:12:10Z")

</div>

Thanks guys, I used ahmed’s idea though, after some reading (i probably should have read the AS reference first), i found that what i really needed was the substring method, because some of my variable values were more that 4 digits, and the charAt only got the third character.

But Thanks, to both of you!
