a) If characters in new string are greater than characters in the previous string.None of the characters should get truncated.
b ) If characters in new string are smaller than characters in the previous string. Junk characters should not be added.
c) Spaces after and before the string should not be deleted.
d) String should be replaced only for the first occurrence of the string.