Added string trimming function definition