trimming the string
<p>I have  java String of say length 10 .Now i want to  reduce it to lenthg of 5 .Is there something i can do like we do in C as shown below</p>

<pre><code> str[6] = '\0' ; //insert null at 6th place so remaining string is ignored.
</code></pre>

<p>I dont want to use inbuilt API of java to do this.The main problem that i wanted to solve is i wanted to remove duplicate characters in string .Now after removing duplicate characters string size is reduced so i want to remove remaining 5 characters.</p>
