is your string long enough? if you cut 1 char from the beginning and 10 from the end, your string should contain at least 11 characters