I have a string like below
12SELVASOFTWAREENGINEER................323
This string length is more than 10000
First two letter of this string is employee Id
So i can get my employee id like below
String empid = str.substring(0,2);
but this string creates the same space for original String
, so memory leak will happen.
How to avoid this?
Is their any alternative or efficient way is their for getting the part of the string in java
Any help will be greatly appreciated!!!