# Find longest string / the easiest way

**URL:** <https://forum.kirupa.com/t/find-longest-string-the-easiest-way/291630>\
**Category:** Uncategorized\
**Created:** [July 2, 2009, 2:31pm UTC](https://forum.kirupa.com/t/find-longest-string-the-easiest-way/291630 "2009-07-02T14:31:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lope](https://avatars.discourse-cdn.com/v4/letter/l/43a26b/32.png) [@lope](https://forum.kirupa.com/u/lope)\
**Post date:** [July 2, 2009, 2:31pm UTC](https://forum.kirupa.com/t/find-longest-string-the-easiest-way/291630/1 "2009-07-02T14:31:25Z")

</div>

I am calling this function:

```auto
function getHighestWidth():void{
    
    for (var i:int = 0; i < myXML.video_title.length(); i++) {
        trace(String(myXML.video_title*).length);
    }
    
}

```

output gives like:  
22  
43  
54  
24  
52  
64  
67  
…

I could push these numbers into array and then sort that array numeric to get the highest number, but is there an even shorter way to return the highest number from these strings?
