StringUtilsTrial.java Source code

Java tutorial

Introduction

Here is the source code for StringUtilsTrial.java

Source

/*
4) Check if 643287460 contains only 0123456789 >>>true
    
 */

import org.apache.commons.lang.StringUtils;

public class StringUtilsTrial {
    public static void main(String[] args) {

        // Check if string contains only a specified set of characters. Return
        // boolean
        System.out.println("4) Check if 643287460 contains only 0123456789 >>>"
                + StringUtils.containsOnly("643287460", "0123456789"));

    }
}