I have a string formed with 6 letters eg: "abcdef". I need to add "." every two characters so it would be like this: "ab.cd.ef". I'm working in java, I tried this:
private String FormatAddress(String sourceAddress) {
char[] sourceAddressFormatted = new char[8];
sourceAddress.getChars(0, 1, sourceAddressFormatted, 0);
sourceAddress += ".";
sourceAddress.getChars(2, 3, sourceAddressFormatted, 3);
sourceAddress += ".";
sourceAddress.getChars(4, 5, sourceAddressFormatted, 6);
String s = new String(sourceAddressFormatted);
return s;
}
But i received strange values such as [C@2723b6.
Thanks in advance:)