This could be accomplished more simply like this: 
string[0, number_characters]