testing replace function for String class