String Module
References
Variables
Default words to exclude when using the titleize operator
Convert Functions
-
Returns an Observable that emits a string value from an Array or
Set
of values joined to a single string using the separator.Parameters
-
separator: Subscribable<string> | string = ' '
The character to join text with, default is a space character
Returns OperatorFunction < Iterable < unknown > , string >
Observable that emits a string from an Array or`Set of values
-
-
Returns an Observable that emits an array from a source string split by the separator using String.split
Parameters
-
separator: Subscribable<string> | string = ' '
The character to split the string at
-
Optional limit: Subscribable<number> | number
Optional limit for the number of times to split
Returns OperatorFunction < string , string [] >
Observable that emits an array of strings from the source string split on the separator
-
Create Functions
-
Returns an Observable that emits a string made from character codes using String.fromCharCode
Parameters
-
input: Subscribable<Iterable<number> | number> | Iterable<number> | number
Single or list of character codes to convert to a string
Returns Observable < string >
Observable that emits a string
-
-
Returns an Observable that emits a string made from code points using String.fromCodePoint
Parameters
-
input: Subscribable<Iterable<number> | number> | Iterable<number> | number
Single or list of code points to convert to a string
Returns Observable < string >
Observable that emits a string
-
-
Returns an Observable that emits strings from any an argument list of strings or supported Observable, Promise or Array-like source
Parameters
-
input: Subscribable<Iterable<string> | string> | Iterable<string> | string
Argument list, Observable input, Promise or Array of strings
Returns Observable < string >
Observable that emits a string
-
-
Returns an Observable that emits a string made from a source unicode string using String.normalize
Parameters
-
input: Subscribable<Iterable<string> | string> | Iterable<string> | string
Single or list of Unicode character to convert to a string
-
Optional form: FormType
The Unicode Normalization Form to decode the string with
Returns Observable < string >
Observable that emits a string
-
Filter Functions
-
Returns an Observable that emits a string where the source string ends with the passed ending using String.endsWith
Parameters
-
search: Subscribable<string> | string
The string to check the source ends with
-
Optional maxLength: Subscribable<number> | number
Optional length of the string to check
Returns MonoTypeOperatorFunction < string >
Observable that emits a string
-
-
Returns an Observable that emits a string where the source string contains with the passed search string using String.includes
Parameters
-
search: Subscribable<string> | string
The string to check the source ends with
Returns MonoTypeOperatorFunction < string >
Observable that emits a string
-
-
Returns an Observable that emits a string where the source string starts with the passed string using String.startsWith
Parameters
-
search: Subscribable<string> | string
The string to check the source starts with
-
Optional startIndex: Subscribable<number> | number
Optional index to start the check from
Returns MonoTypeOperatorFunction < string >
Observable that emits a string
-
Mapping Functions
-
Returns an Observable that emits a string from a source of character codes using String.fromCharCode
Returns OperatorFunction < Iterable < number > | number , string >
Observable that emits a string from source character codes
-
Returns an Observable that emits a string from a source of character codes using String.fromCodePoint
Returns OperatorFunction < Iterable < number > | number , string >
Observable that emits a string from source code points
-
Returns an Observable that emits a string made from a source unicode string using String.normalize
Parameters
-
Optional form: Subscribable<FormType> | FormType
The Unicode Normalization Form to decode the string with
Returns MonoTypeOperatorFunction < string >
Observable that emits a string
-
Modify Functions
-
Returns an Observable that emits a string that is the source string concatenated with the passed input to the operator using Sting.concat
Parameters
-
input: Subscribable<Iterable<string> | string> | Iterable<string> | string
Single or list of arguments to concatenate with the source string
Returns MonoTypeOperatorFunction < string >
Observable that emits a string
-
-
Returns an Observable that emits a string where the source string has been padded using String.padEnd
Parameters
-
maxLength: Subscribable<number> | number
The maximum length to pad the string to
-
Optional fillString: Subscribable<string> | string
Optional string to use as the string padding
Returns MonoTypeOperatorFunction < string >
Observable that emits a string that is padded to the passed length
-
-
Returns an Observable that emits a string where the source string has been padded using String.padStart
Parameters
-
maxLength: Subscribable<number> | number
The maximum length to pad the string to
-
Optional fillString: Subscribable<string> | string
Optional string to use as the string padding
Returns MonoTypeOperatorFunction < string >
Observable that emits a string that is padded to the passed length
-
-
Returns an Observable that emits a string where the source string is repeated with String.repeat.
Parameters
-
count: Subscribable<number> | number
The number of times to repeat the string
-
Optional separator: Subscribable<string> | string
Optional separator for joining strings
Returns MonoTypeOperatorFunction < string >
Observable that emits a string of the source string repeated
-
-
Returns an Observable that emits a string, replacing text in the source string with the replacement text if the pattern is found using String.replace
Parameters
-
pattern: Subscribable<string | RegExp> | string | RegExp
A string or RegExp to find in the Observable string to replace
-
replacement: Subscribable<string> | string
The replacement string
Returns MonoTypeOperatorFunction < string >
Observable that emits a string
-
-
Returns an Observable that emits a string, replacing text in the source string with the replacement text if the pattern is found using String.replaceAll
Parameters
-
pattern: Subscribable<string | RegExp> | string | RegExp
A string or RegExp to find in the Observable string to replace
-
replacement: Subscribable<string> | string
The replacement string
Returns MonoTypeOperatorFunction < string >
Observable that emits a string
-
-
Returns an Observable that emits a string where the source string is reversed.
Returns MonoTypeOperatorFunction < string >
Observable that emits a string that is reversed from the source
-
Returns an Observable that emits a string that is a partial slice of the source string using String.slice
Parameters
-
startIndex: Subscribable<number> | number
The start index for the substring
-
Optional endIndex: Subscribable<number> | number
Optional end index for the length of substring, if not passed slice will use
str.length -1
Returns MonoTypeOperatorFunction < string >
Observable that emits a string that is a slice of the source string
-
-
Returns an Observable that emits a string that is a partial slice of the source string using String.substring
Parameters
-
indexStart: Subscribable<number> | number
The index of the first character to include in the returned substring.
-
Optional indexEnd: Subscribable<number> | number
Optional The index of the first character to exclude from the returned substring.
Returns MonoTypeOperatorFunction < string >
Observable that emits a string that is a substring of the source string
-
-
Return an Observable that emits a string where the source string is titleized (first letter of each word uppercase). The operator uses String.toLocaleUpperCase so can support locale strings
By default is uses the NO_CAP_WORDS to skip some words (unless they are the first word in the string). To disable this pass an empty array, and to extend you can use the default with a spread operator to extend:
[...NO_CAP_WORDS, 'foo', 'bar']
. When using a separator, if no change in default passundefined
It will also skip words already starting with a capital (e.g.
<a href="https://rxjs.dev" target="_blank">RxJS</a>
)Parameters
-
noTitleWords: Subscribable<Iterable<string>> | Iterable<string> = ...
A list of words to exclude from making a title word
-
separator: Subscribable<string> | string = ' '
Optional separator to use when joining each word
-
Optional locales: Subscribable<string> | string
Locales for string formatting
Returns MonoTypeOperatorFunction < string >
Observable that emits a titilzed string
-
-
Returns an Observable that emits a string where the source string is passed through String.toLocaleLowerCase
Parameters
-
Optional locales: Subscribable<Iterable<string> | string> | Iterable<string> | string
Optional locales to pass for string formatting
Returns MonoTypeOperatorFunction < string >
Observable that emits a lower case string
-
-
Returns an Observable that emits a string where the source string is passed through String.toLocaleLowerCase
Parameters
-
Optional locales: Subscribable<Iterable<string> | string> | Iterable<string> | string
Optional locales to pass for string formatting
Returns MonoTypeOperatorFunction < string >
Observable that emits a lower case string
-
-
Returns an Observable that emits a string where the source string has any white space at the ends removed using String.trim
Returns MonoTypeOperatorFunction < string >
Observable that emits a trimmed string
-
Returns an Observable that emits a string where the source string has any white space at the end removed using String.trimEnd
Returns MonoTypeOperatorFunction < string >
Observable that emits a trimmed string
-
Returns an Observable that emits a string where the source string has any white space at the start removed using String.trimStart
Returns MonoTypeOperatorFunction < string >
Observable that emits a trimmed string
Query Functions
-
Returns an Observable that emits an array of strings. The string is returned from String.charAt using the passed index or array of indexes. The output is always an Array containing the string, or empty string if nothing found.
Parameters
-
positions: Subscribable<Iterable<number> | number> | Iterable<number> | number
Single or list of index values to return the character at
Returns OperatorFunction < string , string [] >
Observable that emits an Array of string values
-
-
Returns an Observable that emits an array of numbers. The number is returned from String.charCodeAt using the passed index or array of indexes. The output is always an Array containing the number, or NaN.
Parameters
-
positions: Subscribable<Iterable<number> | number> | Iterable<number> | number
Single or list of index values to return the character at
Returns OperatorFunction < string , number [] >
Observable that emits an Array of number values
-
-
Returns an Observable that emits an array of numbers. The number is returned from String.codePointAt using the passed index or array of indexes. The output is always an Array containing the number, or NaN.
Parameters
-
positions: Subscribable<Iterable<number> | number> | Iterable<number> | number
Single or list of index values to return the character at
Returns OperatorFunction < string , number [] >
Observable that emits a number that is a code point
-
-
Returns an Observable that emits a boolean value where the source string ends with the passed string parameter using String.endsWith
Parameters
-
search: Subscribable<string> | string
The string to check the source ends with
-
Optional maxLength: Subscribable<number> | number
Optional length of the string to check
Returns OperatorFunction < string , boolean >
Observable that emits a boolean of the source string ending with the passed input
-
-
Returns an Observable that emits a boolean where the source string contains with the passed search string using String.includes
Parameters
-
search: Subscribable<string> | string
The string to check the source ends with
Returns OperatorFunction < string , boolean >
Observable that emits a boolean
-
-
Returns an Observable that emits a number of the first index from the source string where the search string begins using String.indexOf
Parameters
-
search: Subscribable<string> | string
The string to search in the source string
-
Optional startIndex: Subscribable<number> | number
Optional start position if not from the beginning of the string
Returns OperatorFunction < string , number >
Observable that emits a number that is the first index of the search string in the source string
-
-
Returns an Observable that emits a number of the last index from the source string where the search string begins using String.lastIndexOf
Parameters
-
search: Subscribable<string> | string
The string to search in the source string
-
Optional lastIndex: Subscribable<number> | number
The index of the last character in the string to search up to
Returns OperatorFunction < string , number >
Observable that emits a number that is the last index of the search string in the source string
-
-
Returns an Observable that emits a
RegExpMatchArray
where a source string returns a valid result using using String.match. If no result is found,null
is emitted.Parameters
-
pattern: Subscribable<string | RegExp> | string | RegExp
A string or RegExp to match
Returns OperatorFunction < string , RegExpMatchArray | null >
Observable that emits a RegExpMatchArray
-
-
Returns an Observable that emits an array of results from String.matchAll
Parameters
-
pattern: Subscribable<RegExp> | RegExp
A RegExp regular expression to match in the string
Returns OperatorFunction < string , RegExpMatchArray [] >
Observable that emits an array of RegExpMatchArray
-
-
Returns an Observable that emits a number that is the first index of where the value is found using String.search
Parameters
-
pattern: Subscribable<string | RegExp> | string | RegExp
A string or RegExp to match in the string
Returns OperatorFunction < string , number >
Observable that emits an number that is the start index of the first found value
-
-
Returns an Observable that emits a boolean when the source string contains the input string at the start of the source string using String.startsWith
Parameters
-
search: Subscribable<string> | string
The string to check the source string start with
-
Optional startIndex: Subscribable<number> | number
Optional start index to being searching the string from
Returns OperatorFunction < string , boolean >
Observable that emits a boolean if the source string start with the input string
-
Generated using TypeDoc, the 18/11/2022 at 13:22:58
Package with operators for generating Observable, filtering, querying and parsing strings in RxJS