Java Tools Class-strutils

Source: Internet
Author: User

 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

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.