Android offers the Textutils class

Source: Internet
Author: User

对于字符串处理Android为我们提供了一个简单实用的TextUtils类,如果处理比较简单的内容不用去思考正则表达式不妨试试这个在android.text.TextUtils的类,主要的功能如下:

是否为空字符 boolean android.text.TextUtils.isEmpty(CharSequence str) 

拼接字符串 String android.text.TextUtils.join(CharSequence delimiter, Object[] tokens)

拆分字符串 String[] android.text.TextUtils.split(String text, String expression)

拆分字符串使用正则 String[] android.text.TextUtils.split(String text, Pattern pattern)

确定大小写是否有效在当前位置的文本 int android.text.TextUtils.getCapsMode(CharSequence cs, int off, int reqModes)

使用HTML编码这个字符串 String android.text.TextUtils.htmlEncode(String s)

Android offers the Textutils class

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.