# Inserting a character into a string

**URL:** https://forum.kirupa.com/t/inserting-a-character-into-a-string/326998
**Category:** flash
**Created:** [January 30, 2012, 2:35am UTC](https://forum.kirupa.com/t/inserting-a-character-into-a-string/326998 "2012-01-30T02:35:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![FlashCS5Novice](https://avatars.discourse-cdn.com/v4/letter/f/8baadc/32.png) [@FlashCS5Novice](https://forum.kirupa.com/u/FlashCS5Novice)
#### Post date: [January 30, 2012, 2:35am UTC](https://forum.kirupa.com/t/inserting-a-character-into-a-string/326998/1 "2012-01-30T02:35:14Z")

</div>

There seems to be a lack of these kinds of topics on Google, so here I am!

Anywho, I need to insert a character at specific areas of a string, but when I use to following code:

```auto
var test:String = "1,1,2,2,3,3";
trace(test.replace(test.slice(5,5), "%N"));

```

this is the output:

```auto
%N1,1,2,2,3,3

```

This strikes me as odd. Shouldn’t it be “1,1,2%N2,3,3” instead? Obviously, I’ve done something wrong along the way, but I’m not sure what I’ve done wrong or how to fix it.

Help! Thanks. :}
