Here you can find the source of deleteWhitespaces(final String string)
Parameter | Description |
---|---|
string | the string that whose white-spaces shall be removed |
null
if the given string was null
public static String deleteWhitespaces(final String string)
//package com.java2s; //License from project: LGPL public class Main { /**/*from w w w.j a va2 s. c om*/ * Deletes all white-spaces from the given string. * * @param string the string that whose white-spaces shall be removed * * @return a string without white-spaces or <code>null</code> if the given string was null */ public static String deleteWhitespaces(final String string) { if (string == null) { return null; } return string.replaceAll("\\s", ""); // NOI18N } }