Java String Sanitize sanitizePackageVersion(String string)

Here you can find the source of sanitizePackageVersion(String string)

Description

Makes a valid and useful package version string from one that cannot be used or is unsuitable.

License

Open Source License

Parameter

Parameter Description
string The string which might contain underscores

Return

The given string without underscores

Declaration

public static String sanitizePackageVersion(String string) 

Method Source Code

//package com.java2s;
/*/*from  w  w  w. jav  a2s  .c o  m*/
 * Maven Packaging Plugin,
 * Maven plugin to package a Project (deb, ipk, izpack)
 * Copyright (C) 2000-2008 tarent GmbH
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License,version 2
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 *
 * tarent GmbH., hereby disclaims all copyright
 * interest in the program 'Maven Packaging Plugin'
 * Signature of Elmar Geese, 11 March 2008
 * Elmar Geese, CEO tarent GmbH.
 */

public class Main {
    /**
     * Makes a valid and useful package version string from one that cannot be
     * used or is unsuitable.
     * 
     * <p>
     * At the moment the method removes underscores only.
     * </p>
     * 
     * @param string
     *            The string which might contain underscores
     * @return The given string without underscores
     */
    public static String sanitizePackageVersion(String string) {

        return string.replaceAll("_", "");
    }
}

Related

  1. sanitizeName(String name)
  2. sanitizeName(String origName)
  3. sanitizeNamespace(String namespace)
  4. sanitizeOperationId(String operationId)
  5. sanitizePackageName(String raw)
  6. sanitizePath(String apiPath)
  7. sanitizePath(String input)
  8. sanitizePrimitives(Class clazz)
  9. sanitizeProcOrFuncName(String src)