# Change a string? easy one i think

**URL:** <https://forum.kirupa.com/t/change-a-string-easy-one-i-think/262384>\
**Category:** Uncategorized\
**Created:** [June 5, 2008, 3:28pm UTC](https://forum.kirupa.com/t/change-a-string-easy-one-i-think/262384 "2008-06-05T15:28:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pantas](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pantas](https://forum.kirupa.com/u/pantas)\
**Post date:** [June 5, 2008, 3:28pm UTC](https://forum.kirupa.com/t/change-a-string-easy-one-i-think/262384/1 "2008-06-05T15:28:12Z")

</div>

hi there!

thanks in advance for checking this post…  
i think this is a easy one…

i’m trying to edit the last character of a string…but have no idea on how to do it…

any ideas?

---

<div class="post-metadata">

**Author:** ![creatify](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creatify](https://forum.kirupa.com/u/creatify)\
**Post date:** [June 5, 2008, 3:57pm UTC](https://forum.kirupa.com/t/change-a-string-easy-one-i-think/262384/2 "2008-06-05T15:57:26Z")

</div>

like - replace the last character with something else?

for more information - look up the String class here: [adobe livedocs](http://www.adobe.com/livedocs/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002708.html)

```auto

var str:String = "asdfasdf";
// the substr method will take all characters starting at index 0 up to the last character minue one.
var strreplace:String = str.substr(0,-1)+"Q"
trace(strreplace); // output: asdfasdQ

```

---

<div class="post-metadata">

**Author:** ![pantas](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pantas](https://forum.kirupa.com/u/pantas)\
**Post date:** [June 5, 2008, 5:03pm UTC](https://forum.kirupa.com/t/change-a-string-easy-one-i-think/262384/3 "2008-06-05T17:03:39Z")

</div>

thanks !

you rule! 😃
