# Stripping strings

**URL:** <https://forum.kirupa.com/t/stripping-strings/117565>\
**Category:** Uncategorized\
**Created:** [July 28, 2004, 2:08pm UTC](https://forum.kirupa.com/t/stripping-strings/117565 "2004-07-28T14:08:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fumeng](https://avatars.discourse-cdn.com/v4/letter/f/a9adbd/32.png) [@fumeng](https://forum.kirupa.com/u/fumeng)\
**Post date:** [July 28, 2004, 2:08pm UTC](https://forum.kirupa.com/t/stripping-strings/117565/1 "2004-07-28T14:08:38Z")

</div>

hi.

i have 10 sentences i am importing into flash from xml. here is a sample:

```auto

my frog has four legs!

```

i parse it and place it in a variable c.

what i really want is the punctuation put into its own array. i strip c like this:

```auto

var strings = c.split(" ");

```

and of course that places every character into the array and the last character is “legs!”.

for other purposes i need to split it in every character but how can i now separate the punctuation (in order) so i can recall it later.

thanks. fumeng.

---

<div class="post-metadata">

**Author:** ![bodyvisual](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bodyvisual/32/564_2.png) [@bodyvisual](https://forum.kirupa.com/u/bodyvisual)\
**Post date:** [July 28, 2004, 2:13pm UTC](https://forum.kirupa.com/t/stripping-strings/117565/2 "2004-07-28T14:13:20Z")

</div>

i don’t understand what you’re asking exactly…

:p:

---

<div class="post-metadata">

**Author:** ![fumeng](https://avatars.discourse-cdn.com/v4/letter/f/a9adbd/32.png) [@fumeng](https://forum.kirupa.com/u/fumeng)\
**Post date:** [July 28, 2004, 2:26pm UTC](https://forum.kirupa.com/t/stripping-strings/117565/3 "2004-07-28T14:26:09Z")

</div>

hi. thanks for responding.

i’m just trying to break up a string:

```auto

var c:String = "my frog has four legs!"

```

into a substring.

i’ve already broken it up using:

```auto

tempString = c.split(" ");

```

and that creates an array that looks like this:

```auto

tempString = (my,frog,has,four,legs!);

```

but what i really want in the end is a substring that contains only the punctuation, i.e.

```auto

puncString = (!,!,.,?,.);

```

know what i mean?

---

<div class="post-metadata">

**Author:** ![bodyvisual](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bodyvisual/32/564_2.png) [@bodyvisual](https://forum.kirupa.com/u/bodyvisual)\
**Post date:** [July 28, 2004, 2:28pm UTC](https://forum.kirupa.com/t/stripping-strings/117565/4 "2004-07-28T14:28:27Z")

</div>

couldn’t you use multiple array.split()? like…

my\_array.split("!");  
my\_array.split(".");  
my\_array.split("?");

it’s bulky, but it would work…

:p:
