This method converts the string into a new character array.
String STR = "abcdefg ";
Char A [];
A = Str. tochararray ();
You can also use the following methods:
Getchars
Public void getchars (INT srcbegin,
Int srcend,
Char DST [],
Int dstbegin)
Copy the character from the string to the destination character array.
The first character to be copied is at the index srcbegin; the last character to be copied is at the index srcEnd-1 (so the total number of characters to be copied is srcend-srcbegin ). The characters to be copied to the DST sub-array start with index dstbegin and end with index:
Dstbegin + (srcend-srcbegin)-1
Parameters:
Srcbegin-index of the first character in the string to be copied.
Srcend-index of the last character in the string to be copied.
DST-destination array.
Dstbegin-start offset in the target array.
String STR = "abcdefg ";
Char A [];
Str. getchars (0, str. Length (), A, 0 );
Writing is a bit messy, but careful analysis is still very interesting.