Amdocs interview question

Write a program to reverse the string by not changing the special characters of that string. Difference between a string and string builder