Public classStrutils { Public Static FinalString utf_8 = "UTF-8"; /*** Remove the useless 0 after the decimal string*/ Public Staticstring Replacethetailzero (String value) {if(Stringutils.isempty (value)) {returnvalue; } if(Value.indexof (".") > 0) {Value=value.replaceall ("0+?$", "" ");//remove the useless 0 behindValue =value.replaceall ("[.] $", "");//the decimal point is removed if all zeros are followed by a decimal point } returnvalue; } /*** UTF-8 character length conversion*/ Public Static intGetstrbytelen (String value)throwsunsupportedencodingexception{if(Stringutils.isempty (value)) {return0; } returnvalue.getbytes (utf_8). length; } /*** Verify that it is empty*/ Public Static Booleanvalidationisnull (String value) {if(Stringutils.isempty (value)) {return true; } if(Stringutils.trim (value). Length () = = 0) { return true; } return false; }}
Java Tools Class-strutils