With GNU bash and its Parameter Expansion:
str='Please help me do my homework !!!' echo "${str:0: -4}"
Output:
Please help me do my homework