Class StringFunctions
java.lang.Object
com.couchbase.client.java.query.dsl.functions.StringFunctions
@Experimental @Public public class StringFunctions extends Object
DSL for N1QL functions in the Strings category.
String functions perform operations on a string input value and returns a string or other value.
- Since:
- 2.2
- Author:
- Simon Baslé
-
Method Summary
Modifier and Type Method Description static Expressioncontains(Expression expression, String substring)Returned expression results in True if the string expression contains the substring.static Expressioncontains(String expression, String substring)Returned expression results in True if the string expression contains the substring.static ExpressioninitCap(Expression expression)Returned expression results in the conversion of the string so that the first letter of each word is uppercase and every other letter is lowercase.static ExpressioninitCap(String expression)Returned expression results in the conversion of the string so that the first letter of each word is uppercase and every other letter is lowercase.static Expressionlength(Expression expression)Returned expression results in the length of the string expression.static Expressionlength(String expression)Returned expression results in the length of the string expression.static Expressionlower(Expression expression)Returned expression results in the given string expression in lowercasestatic Expressionlower(String identifier)Returned expression results in the string value for the given identifier, in lowercasestatic Expressionltrim(Expression expression)Returned expression results in the string with all leading white spaces removed.static Expressionltrim(Expression expression, String characters)Returned expression results in the string with all leading chars removed (any char in the characters string).static Expressionltrim(String expression)Returned expression results in the string with all leading white spaces removed.static Expressionltrim(String expression, String characters)Returned expression results in the string with all leading chars removed (any char in the characters string).static Expressionposition(Expression expression, String substring)Returned expression results in the first position of the substring within the string, or -1.static Expressionposition(String expression, String substring)Returned expression results in the first position of the substring within the string, or -1.static Expressionrepeat(Expression expression, int n)Returned expression results in the string formed by repeating expression n times.static Expressionrepeat(String expression, int n)Returned expression results in the string formed by repeating expression n times.static Expressionreplace(Expression expression, String substring, String repl)Returned expression results in a string with all occurrences of substr replaced with repl.static Expressionreplace(Expression expression, String substring, String repl, int n)Returned expression results in a string with at most n occurrences of substr replaced with repl.static Expressionreplace(String expression, String substring, String repl)Returned expression results in a string with all occurrences of substr replaced with repl.static Expressionreplace(String expression, String substring, String repl, int n)Returned expression results in a string with at most n occurrences of substr replaced with repl.static Expressionrtrim(Expression expression)Returned expression results in the string with all trailing white spaces removed.static Expressionrtrim(Expression expression, String characters)Returned expression results in the string with all trailing chars removed (any char in the characters string).static Expressionrtrim(String expression)Returned expression results in the string with all trailing white spaces removed.static Expressionrtrim(String expression, String characters)Returned expression results in the string with all trailing chars removed (any char in the characters string).static Expressionsplit(Expression expression)Returned expression results in a split of the string into an array of substrings separated by any combination of white space characters.static Expressionsplit(Expression expression, String sep)Returned expression results in a split of the string into an array of substrings separated by sep.static Expressionsplit(String expression)Returned expression results in a split of the string into an array of substrings separated by any combination of white space characters.static Expressionsplit(String expression, String sep)Returned expression results in a split of the string into an array of substrings separated by sep.static Expressionsubstr(Expression expression, int position)Returned expression results in a substring from the integer position to the end of the string.static Expressionsubstr(Expression expression, int position, int length)Returned expression results in a substring from the integer position of the given length.static Expressionsubstr(String expression, int position)Returned expression results in a substring from the integer position to the end of the string.static Expressionsubstr(String expression, int position, int length)Returned expression results in a substring from the integer position of the given length.static Expressiontitle(Expression expression)Returned expression results in the conversion of the string so that the first letter of each word is uppercase and every other letter is lowercase.static Expressiontitle(String expression)Returned expression results in the conversion of the string so that the first letter of each word is uppercase and every other letter is lowercase.static Expressiontrim(Expression expression)Returned expression results in the string with all leading and trailing white spaces removed.static Expressiontrim(Expression expression, String characters)Returned expression results in the string with all leading and trailing chars removed (any char in the characters string).static Expressiontrim(String expression)Returned expression results in the string with all leading and trailing white spaces removed.static Expressiontrim(String expression, String characters)Returned expression results in the string with all leading and trailing chars removed (any char in the characters string).static Expressionupper(Expression expression)Returned expression results in uppercase of the string expression.static Expressionupper(String expression)Returned expression results in uppercase of the string expression.
-
Method Details
-
contains
Returned expression results in True if the string expression contains the substring. -
contains
Returned expression results in True if the string expression contains the substring. -
initCap
Returned expression results in the conversion of the string so that the first letter of each word is uppercase and every other letter is lowercase. -
initCap
Returned expression results in the conversion of the string so that the first letter of each word is uppercase and every other letter is lowercase. -
title
Returned expression results in the conversion of the string so that the first letter of each word is uppercase and every other letter is lowercase. -
title
Returned expression results in the conversion of the string so that the first letter of each word is uppercase and every other letter is lowercase. -
length
Returned expression results in the length of the string expression. -
length
Returned expression results in the length of the string expression. -
lower
Returned expression results in the given string expression in lowercase -
lower
Returned expression results in the string value for the given identifier, in lowercase -
ltrim
Returned expression results in the string with all leading white spaces removed. -
ltrim
Returned expression results in the string with all leading white spaces removed. -
ltrim
Returned expression results in the string with all leading chars removed (any char in the characters string). -
ltrim
Returned expression results in the string with all leading chars removed (any char in the characters string). -
position
Returned expression results in the first position of the substring within the string, or -1. The position is zero-based, i.e., the first position is 0. -
position
Returned expression results in the first position of the substring within the string, or -1. The position is zero-based, i.e., the first position is 0. -
repeat
Returned expression results in the string formed by repeating expression n times. -
repeat
Returned expression results in the string formed by repeating expression n times. -
replace
Returned expression results in a string with all occurrences of substr replaced with repl. -
replace
Returned expression results in a string with all occurrences of substr replaced with repl. -
replace
Returned expression results in a string with at most n occurrences of substr replaced with repl. -
replace
Returned expression results in a string with at most n occurrences of substr replaced with repl. -
rtrim
Returned expression results in the string with all trailing white spaces removed. -
rtrim
Returned expression results in the string with all trailing white spaces removed. -
rtrim
Returned expression results in the string with all trailing chars removed (any char in the characters string). -
rtrim
Returned expression results in the string with all trailing chars removed (any char in the characters string). -
split
Returned expression results in a split of the string into an array of substrings separated by any combination of white space characters. -
split
Returned expression results in a split of the string into an array of substrings separated by any combination of white space characters. -
split
Returned expression results in a split of the string into an array of substrings separated by sep. -
split
Returned expression results in a split of the string into an array of substrings separated by sep. -
substr
Returned expression results in a substring from the integer position of the given length. The position is zero-based, i.e. the first position is 0. If position is negative, it is counted from the end of the string; -1 is the last position in the string. -
substr
Returned expression results in a substring from the integer position of the given length. The position is zero-based, i.e. the first position is 0. If position is negative, it is counted from the end of the string; -1 is the last position in the string. -
substr
Returned expression results in a substring from the integer position to the end of the string. The position is zero-based, i.e. the first position is 0. If position is negative, it is counted from the end of the string; -1 is the last position in the string. -
substr
Returned expression results in a substring from the integer position to the end of the string. The position is zero-based, i.e. the first position is 0. If position is negative, it is counted from the end of the string; -1 is the last position in the string. -
trim
Returned expression results in the string with all leading and trailing white spaces removed. -
trim
Returned expression results in the string with all leading and trailing white spaces removed. -
trim
Returned expression results in the string with all leading and trailing chars removed (any char in the characters string). -
trim
Returned expression results in the string with all leading and trailing chars removed (any char in the characters string). -
upper
Returned expression results in uppercase of the string expression. -
upper
Returned expression results in uppercase of the string expression.
-