Determines whether the input string consists of spaces, tabs, carriage returns, and line breaks.

Source: Internet
Author: User
 1 public class StringUtils 
2 {
3 /**
4 * determine whether the given string is a blank string. <Br>
5 * a blank string is a string consisting of spaces, tabs, carriage returns, and line breaks. <br>
6 * If the input string is null or a null String, true is returned.
7 * @ param input
8 * @ return boolean
9 */
10 public static boolean isBlank (String input)
11 {
12 if (input = null | "". equals (input ))
13 return true;
14
15 for (int I = 0; I <input. length (); I ++)
16 {
17 char c = input. charAt (I );
18 if (c! = ''& C! = '\ T' & c! = '\ R' & c! = '\ N ')
19 {
20 return false;
21}
22}
23 return true;
24}
25}
1 private boolean checkContent (){
2 boolean ret = true;
3 if (StringUtils. isBlank (content. getText (). toString ())){
4 Toast. makeText (mContext, "Please input your feedback. Thank you", Toast. LENGTH_SHORT). show ();
5 ret = false;
6}
7 return ret;
8}


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.