Available Methods
- isBlank ( )
- isEmpty ( )
- isNotBlank ( )
- isNotEmpty ( )
- equals ( )
- join ( )
- EMPTY
- split ( )
- trimToNull ( )
- equalsIgnoreCase ( )
- contains ( )
- replace ( )
- trimToEmpty ( )
- isNumeric ( )
- capitalize ( )
- defaultString ( )
- startsWith ( )
- substringAfter ( )
- trim ( )
- isNoneBlank ( )
- containsIgnoreCase ( )
- substringBefore ( )
- substringAfterLast ( )
- removeEnd ( )
- repeat ( )
- leftPad ( )
- lowerCase ( )
- countMatches ( )
- substring ( )
- isNoneEmpty ( )
- endsWith ( )
- startsWithIgnoreCase ( )
- stripEnd ( )
- replaceEach ( )
- abbreviate ( )
- defaultIfBlank ( )
- splitByWholeSeparator ( )
- uncapitalize ( )
- strip ( )
- rightPad ( )
- substringBeforeLast ( )
- defaultIfEmpty ( )
- substringBetween ( )
- length ( )
- removeStart ( )
- remove ( )
- isAnyEmpty ( )
- replaceChars ( )
- indexOf ( )
- isAnyBlank ( )
- joinWith ( )
- containsAny ( )
- replaceOnce ( )
- endsWithIgnoreCase ( )
- splitByWholeSeparatorPreserveAllTokens ( )
- splitPreserveAllTokens ( )
- startsWithAny ( )
- deleteWhitespace ( )
- appendIfMissing ( )
- compare ( )
- normalizeSpace ( )
- stripStart ( )
- replaceAll ( )
- lastIndexOf ( )
- equalsAnyIgnoreCase ( )
- stripToNull ( )
- upperCase ( )
- splitByCharacterTypeCamelCase ( )
- left ( )
- reverse ( )
- isAlphanumeric ( )
- center ( )
- isAsciiPrintable ( )
- chomp ( )
- getLevenshteinDistance ( )
- indexOfIgnoreCase ( )
- chop ( )
- equalsAny ( )
- isAllLowerCase ( )
- ordinalIndexOf ( )
- replacePattern ( )
- removeEndIgnoreCase ( )
- containsNone ( )
- isAllBlank ( )
- truncate ( )
- isAllEmpty ( )
- difference ( )
- stripAll ( )
- right ( )
- stripAccents ( )
- containsWhitespace ( )
- endsWithAny ( )
- isWhitespace ( )
- removeStartIgnoreCase ( )
- replaceIgnoreCase ( )
- indexOfAnyBut ( )
- swapCase ( )
- substringsBetween ( )
- wrap ( )
- toCodePoints ( )
- wrapIfMissing ( )
- isAllUpperCase ( )
- isAlpha ( )
- reverseDelimited ( )
- toEncodedString ( )
- compareIgnoreCase ( )
- containsOnly ( )
- removeFirst ( )
Related Classes
- java.util.Arrays
- java.io.File
- java.util.Collections
- java.io.InputStream
- java.util.Date
- java.util.Iterator
- java.util.concurrent.TimeUnit
- java.util.regex.Pattern
- java.net.URL
- java.io.FileInputStream
- java.text.SimpleDateFormat
- java.util.Locale
- java.lang.reflect.Method
- java.util.regex.Matcher
- java.util.Properties
- java.util.UUID
- java.util.stream.Collectors
- java.util.LinkedHashMap
- java.util.Objects
- java.nio.charset.Charset
- java.net.URI
- java.util.Map.Entry
- java.nio.file.Files
- java.util.Optional
- java.nio.charset.StandardCharsets
Java Code Examples for org.apache.commons.lang3.StringUtils#indexOfAnyBut()
The following examples show how to use
org.apache.commons.lang3.StringUtils#indexOfAnyBut() .
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: UriUtils.java From vividus with Apache License 2.0 | 6 votes |
public static URI buildNewUrl(URI url, String relativeUrl) { int indexOfFirstNonSlashChar = StringUtils.indexOfAnyBut(relativeUrl, SLASH); String normalizedRelativeUrl = indexOfFirstNonSlashChar > 1 ? relativeUrl.substring(indexOfFirstNonSlashChar - 1) : relativeUrl; try { URI parsedRelativeUrl = URI.create(normalizedRelativeUrl); if (url.isOpaque()) { return new URI(url.getScheme(), url.getSchemeSpecificPart(), parsedRelativeUrl.getFragment()); } String path = StringUtils.repeat(SLASH, indexOfFirstNonSlashChar - 1) + parsedRelativeUrl.getPath(); return new URI(url.getScheme(), url.getAuthority(), path, parsedRelativeUrl.getQuery(), parsedRelativeUrl.getFragment()); } catch (URISyntaxException e) { throw new IllegalArgumentException(e.getMessage(), e); } }
Example 2
Source File: AbstractBaseYaml.java From baleen with Apache License 2.0 | 5 votes |
private static String replaceStartingTabsWithSpaces(String line) { int index = StringUtils.indexOfAnyBut(line, "\t "); if (index == -1) { return line; } else { String start = line.substring(0, index).replaceAll("\t", TAB_AS_SPACES); String end = line.substring(index); return start + end; } }
Example 3
Source File: HintHandler.java From windup with Eclipse Public License 1.0 | 4 votes |
public static String trimLeadingAndTrailingSpaces(String markdown) { StringBuilder markdownSB = new StringBuilder(); StringBuilder currentLine = new StringBuilder(); String firstLineIndent = null; for (int i = 0; i < markdown.length(); i++) { char currentChar = markdown.charAt(i); if (currentChar == '\r' || currentChar == '\n') { String currentLineString = currentLine.toString(); if (firstLineIndent == null && !StringUtils.isEmpty(currentLineString)) { int firstNonWhitespaceIndex = StringUtils.indexOfAnyBut(currentLineString, " \t"); if (firstNonWhitespaceIndex != -1) firstLineIndent = currentLineString.substring(0, firstNonWhitespaceIndex); } if (firstLineIndent != null) currentLineString = StringUtils.removeStart(currentLineString, firstLineIndent); markdownSB.append(currentLineString).append(SystemUtils.LINE_SEPARATOR); currentLine.setLength(0); // skip the next line separator for \r\n cases if (currentChar == '\r' && markdown.length() > (i + 1) && markdown.charAt(i + 1) == '\n') { i++; } } else { currentLine.append(currentChar); } } markdownSB.append(currentLine); return markdownSB.toString(); }