Here you can find the source of wildCard(final String _name)
Parameter | Description |
---|---|
_name | a parameter |
public static String wildCard(final String _name)
//package com.java2s; /*L//from ww w .j ava 2s . c o m * Copyright Ekagra Software Technologies * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/common-logging-module/LICENSE.txt for details. */ public class Main { /** * This method appends wild cards before and after a string./ * * @param _name * @return */ public static String wildCard(final String _name) { String trimmedName = _name.toString().trim(); if (trimmedName == null || trimmedName.equals("") || trimmedName.length() == 0) { return ""; } if (trimmedName.length() > 0 && !trimmedName.endsWith("%")) { trimmedName = trimmedName + "%"; } if (trimmedName.length() > 0 && !trimmedName.startsWith("%")) { trimmedName = "%" + trimmedName; } return trimmedName; } }