Collection of java float string extraction methods and java Collection

Source: Internet
Author: User

Collection of java float string extraction methods and java Collection
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.