# Right() function as3?

**URL:** https://forum.kirupa.com/t/right-function-as3/270920
**Category:** flash
**Created:** [September 16, 2008, 7:26am UTC](https://forum.kirupa.com/t/right-function-as3/270920 "2008-09-16T07:26:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![artheus](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@artheus](https://forum.kirupa.com/u/artheus)
#### Post date: [September 16, 2008, 7:26am UTC](https://forum.kirupa.com/t/right-function-as3/270920/1 "2008-09-16T07:26:28Z")

</div>

hey there… I’m just wondering… is there a function like right() or left() (in c/vb)…  
where I can read small parts of a text.

Something like this:

```auto

var myString:String = "";
 
myString = "Hello World!";
 
trace(left(myString, 5)); //outputs the 5 first chars "Hello";
 
trace(right(myString, 6)); //outputs the 6 last chars "World!";

```

well… the right starts from the right and reads to the left (as many chars as input. eg. 5 or 6 as in the example)

Cheers!
