Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

StringUtils class not working in Android

I am using StringUtils class in Android code. but exception generated i.e. class not found. But already i used jar file for that class. Please help me!

like image 849
Ranjit Chandel Avatar asked Sep 13 '12 10:09

Ranjit Chandel


People also ask

What is StringUtils class in Java?

The StringUtils class defines certain words related to String handling. null - null. empty - a zero-length string ( "" ) space - the space character ( ' ' , char 32) whitespace - the characters defined by Character.isWhitespace(char)

What does StringUtils empty return?

Return value This method returns true if the string is null or the length of the string is zero; otherwise, it returns false .

Why use String Utils?

Most common use of StringUtils is in web projects (when you want to check for blank or null strings, checking if a string is number, splitting strings with some token). StringUtils helps to get rid of those nasty NumberFormat and Null exceptions. But StringUtils can be used anywhere String is used.


1 Answers

Try not to use external libraries. Look always for an Android alternative.

For this specific case, you could use: android.text.TextUtils

like image 162
Miguel Rivero Avatar answered Oct 20 '22 05:10

Miguel Rivero