# Substr()?

**URL:** <https://forum.kirupa.com/t/substr/315230>\
**Category:** Uncategorized\
**Created:** [October 20, 2010, 4:49pm UTC](https://forum.kirupa.com/t/substr/315230 "2010-10-20T16:49:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TCDown](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@TCDown](https://forum.kirupa.com/u/TCDown)\
**Post date:** [October 20, 2010, 4:49pm UTC](https://forum.kirupa.com/t/substr/315230/1 "2010-10-20T16:49:57Z")

</div>

Hi

Can anyone look at the code below and explain why it works sometimes and not others?  
strSl\_Title is taken from an array and the whole process is in a loop.

```auto

if (strSl_Title.length>31) {
        myString = strSl_Title.substr(0 , 28) ;
        strSl_Title = ""+myString+"...";
    }

```

It appears to be something to do with spaces in the string but I ain’t sure?  
Publishing for FP8

Cheers TC
