Here you can find the source of isMoney(String money)
public static boolean isMoney(String money)
//package com.java2s; //License from project: Apache License public class Main { public static boolean isMoney(String money) { money = money.trim();// w ww . j av a 2 s. c o m if (money.startsWith("$")) { return (false); } if (money.length() > 0 && money.trim().matches("^(\\d*(\\.\\d\\d?)?|\\d+)$")) { return (true); } else { return (false); } } }