Java Wildcard wildCard(String _name)

Here you can find the source of wildCard(String _name)

Description

wild Card

License

BSD License

Declaration

public static String wildCard(String _name) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright Duke Comprehensive Cancer Center and SemanticBits
 * //from   ww  w . j  a  v  a  2 s.c  o  m
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.com/c3pr/LICENSE.txt for details.
 ******************************************************************************/

public class Main {
    public static String wildCard(String _name) {
        String trimmedName = _name.toString().trim();

        if (trimmedName == null || trimmedName.equals("") || trimmedName.length() == 0) {
            return "";
        } else if (trimmedName.length() > 0 && !trimmedName.endsWith("%")) {
            return trimmedName + "%";
        } else {
            return trimmedName;
        }
    }
}

Related

  1. wildCard(final String _name)
  2. wildCardBoth(String s)
  3. wildcardCompare(String s, String z)
  4. wildcardCriterionSQL(final String query)
  5. wildcardIfEmpty(String inString)