国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

看例子練apache commons之lang篇

2019-11-18 14:55:27
字體:
來源:轉載
供稿:網友

看commons包時的相關練習,可以用這個包提高編碼效率。

package org.raistlin.test.apache;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;

import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.CharSet;
import org.apache.commons.lang.CharSetUtils;
import org.apache.commons.lang.ClassUtils;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.SerializationUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.SystemUtils;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.lang.time.StopWatch;

public class LangDemo
{
    public void charSetDemo()
    {
        System.out.        CharSet charSet = CharSet.getInstance("aeiou");
        String demoStr = "The quick brown fox jumps over the lazy dog.";
        int count = 0;
        for (int i = 0, len = demoStr.length(); i < len; i++)
        {
            if (charSet.contains(demoStr.charAt(i)))
            {
                count++;
            }
        }
        System.out.println("count: " + count);
    }

    public void charSetUtilsDemo()
    {
        System.out.println("**CharSetUtilsDemo**");
        System.out.println("計算字符串中包含某字符數.");
        System.out.println(CharSetUtils.count(
                "The quick brown fox jumps over the lazy dog.", "aeiou"));



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 彩票| 城口县| 南昌县| 锦屏县| 中方县| 武功县| 乌鲁木齐市| 北海市| 衡阳县| 谢通门县| 简阳市| 塔河县| 温宿县| 滨海县| 文登市| 剑阁县| 陇南市| 东海县| 南川市| 丹阳市| 平乡县| 灌云县| 基隆市| 宽甸| 泾阳县| 青阳县| 酉阳| 株洲县| 大余县| 庆阳市| 鄂州市| 喀什市| 昔阳县| 武陟县| 嘉黎县| 金秀| 盐边县| 松滋市| 莆田市| 乐清市| 孟村|