Java Foundation string wrapper class. Use of the Replace method and usage scenarios for char and character sequences

Source: Internet
Author: User

Ptlink0.settext (Arbu.getptlink (). Replace ("&", "&" ));                   // if the substitution like ' & ', ' & ' is not possible, because ' is used for char, to replace the character sequence, you need to use ""

. Replace is used to replace multiple char characters or sequence of characters (String):

//when reading, the parser automatically converts it back to special characters such as "&", "<", ">", and, normally, only the "<" character and "&" characters are strictly forbidden for XML. //The following are the characters that need to be escaped in XML://& (Logic and) &amp;//< (less than) &lt;//> (greater than) &gt;//"(double quotes) &quot;//' (single quotes) &apos;//when the browser opens the XML file, the escape character is automatically reversed and displayed normally//when parsing the XML, the parser automatically converts it back to special characters such as "&", "<", ">", and so does not need to be escaped for recoverability.Ptlink0.settext (Arbu.getptlink (). Replace ("&", "&amp;"). Replace ("<", "&lt;"). Replace (">", "&gt;"). Replace ("\" "," &quot; "). Replace ("\", "&apos;")                );

Java Foundation string wrapper class. Use of the Replace method and usage scenarios for char and character sequences

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.