Replaced use of String.replace with simple String.substring usage