Available Methods
- isBlank ( )
- isNotBlank ( )
- isEmpty ( )
- isNotEmpty ( )
- equals ( )
- join ( )
- split ( )
- EMPTY
- equalsIgnoreCase ( )
- replace ( )
- isNumeric ( )
- contains ( )
- trimToNull ( )
- substringAfter ( )
- substringBetween ( )
- defaultIfBlank ( )
- trim ( )
- substringAfterLast ( )
- capitalize ( )
- repeat ( )
- rightPad ( )
- leftPad ( )
- trimToEmpty ( )
- startsWith ( )
- countMatches ( )
- substringBeforeLast ( )
- containsIgnoreCase ( )
- substringBefore ( )
- startsWithIgnoreCase ( )
- substring ( )
- removeEnd ( )
- remove ( )
- defaultString ( )
- removeStart ( )
- endsWith ( )
- strip ( )
- stripStart ( )
- uncapitalize ( )
- defaultIfEmpty ( )
- abbreviate ( )
- indexOf ( )
- endsWithIgnoreCase ( )
- trimImports ( )
- lowerCase ( )
- left ( )
- splitPreserveAllTokens ( )
- isWhitespace ( )
- upperCase ( )
- deleteWhitespace ( )
- getLevenshteinDistance ( )
- splitByWholeSeparatorPreserveAllTokens ( )
- startsWithAny ( )
- stripToNull ( )
- stripEnd ( )
- replaceEach ( )
- replaceChars ( )
- containsAny ( )
- ordinalIndexOf ( )
- length ( )
- replaceOnce ( )
- splitByWholeSeparator ( )
- lastIndexOf ( )
- containsOnly ( )
- getCommonPrefix ( )
- normalizeSpace ( )
- reverse ( )
- right ( )
- chomp ( )
- substringsBetween ( )
- INDEX_NOT_FOUND
- removeStartIgnoreCase ( )
- indexOfIgnoreCase ( )
- indexOfAny ( )
Related Classes
- java.util.Arrays
- java.io.File
- java.util.Collections
- java.io.InputStream
- java.util.Date
- java.util.Iterator
- java.util.regex.Pattern
- java.net.URL
- java.io.BufferedReader
- java.io.FileInputStream
- java.text.SimpleDateFormat
- java.util.Locale
- java.util.regex.Matcher
- java.util.Properties
- java.util.UUID
- java.io.UnsupportedEncodingException
- java.util.stream.Collectors
- java.util.Calendar
- java.net.URI
- java.util.Map.Entry
- java.nio.charset.StandardCharsets
- java.text.ParseException
- javax.servlet.http.HttpServletRequest
- javax.servlet.http.HttpServletResponse
- org.springframework.web.bind.annotation.RequestMapping
Java Code Examples for org.apache.commons.lang.StringUtils#normalizeSpace()
The following examples show how to use
org.apache.commons.lang.StringUtils#normalizeSpace() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RequestWrapper.java From oxAuth with MIT License | 6 votes |
public String getContent() { try { if (this.parameterMap.isEmpty()) { if (ArrayUtils.isEmpty(content)) content = IOUtils.toByteArray(delegate.getInputStream()); else content = IOUtils.toByteArray(new LoggingServletInputStream(content)); } else { content = getContentFromParameterMap(this.parameterMap); } String requestEncoding = delegate.getCharacterEncoding(); String normalizedContent = StringUtils.normalizeSpace(new String(content, requestEncoding != null ? requestEncoding : StandardCharsets.UTF_8.name())); return StringUtils.isBlank(normalizedContent) ? null : normalizedContent; } catch (IOException e) { throw new IllegalStateException(); } }
Example 2
Source File: AliasesParser.java From Skript with GNU General Public License v3.0 | 5 votes |
/** * Fixes an alias name by trimming it and removing all extraneous spaces * between the words. * @param name Name to be fixed. * @return Name fixed. */ protected String fixName(String name) { String result = StringUtils.normalizeSpace(name); int i = result.indexOf('¦'); if (i != -1 && Character.isWhitespace(result.codePointBefore(i))) result = result.substring(0, i - 1) + result.substring(i); return result; }
Example 3
Source File: TextPair.java From dkpro-jwpl with Apache License 2.0 | 5 votes |
/** * Normalizes the Strings in the TextPair. * This mainly deals with whitespace-issues. * Other normalizations can be included. * * @param str * @return */ private String normalize(String str){ str = StringUtils.trimToEmpty(str); str = StringUtils.normalizeSpace(str); // remove whitespace before punctuation. not using \p{Punct}, // because it includes to many special characters. str = str.replaceAll("\\s+(?=[.!,\\?;:])", ""); return str; }