cut_string_length function

Cut string to desired length