Package astra.lang
Class Strings
- java.lang.Object
-
- astra.core.Module
-
- astra.lang.Strings
-
public class Strings extends Module
This API provides support for manipulating strings in ASTRA.- Author:
- Rem Collier
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class astra.core.Module
Module.ACTION, Module.EVENT, Module.FORMULA, Module.SENSOR, Module.SUPPRESS_NOTIFICATIONS, Module.TERM
-
-
Constructor Summary
Constructors Constructor Description Strings()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description charcharAt(String source, int index)Term that returns the character at the given index in the source string.FormulaendsWith(String text, String pattern)Formula that checks if the text ends with the pattern.Formulaequal(String source, String target)Formula that checks if the two strings are equals.ListTermsplit(String source, String delimiter)Term that splits the string into an ASTRA list of tokens separated by the given delimiter.FormulastartsWith(String text, String pattern)Formula that checks if the text starts with the pattern.
-
-
-
Method Detail
-
equal
public Formula equal(String source, String target)
Formula that checks if the two strings are equals.- Parameters:
source- one stringtarget- the other string- Returns:
- the formula TRUE if the strings are equal, the formula FALSE otherwise
-
startsWith
public Formula startsWith(String text, String pattern)
Formula that checks if the text starts with the pattern.- Parameters:
text- the textpattern- the pattern- Returns:
- the formula TRUE if the strings are equal, the formula FALSE otherwise
-
endsWith
public Formula endsWith(String text, String pattern)
Formula that checks if the text ends with the pattern.- Parameters:
text- the textpattern- the pattern- Returns:
- the formula TRUE if the strings are equal, the formula FALSE otherwise
-
charAt
public char charAt(String source, int index)
Term that returns the character at the given index in the source string.- Parameters:
source- the stringindex- the index of the character in the string- Returns:
- the character at the given index in the string
-
-