«
Rule languages supports String Items
type | name | label | group |
---|---|---|---|
String | StringOne | String One | Strings |
String | StringTwo | String Two | Strings |
String | StringThree | String Three | Strings |
StringOne << StringOne + " World!"
StringOne << "Hello " + StringOne
# Get all StringItems
items.grep(StringItem)
.each { |string| logger.info("#{string.id} is a String Item") }
case StringOne
when /Hello/ then logger.info("matched")
else
logger.info("did not match")
end
# Get all Strings that start with an H
Strings.grep(/^H/)
.each { |string| logger.info("#{string.id} starts with an H") }
type | name | label | group |
---|---|---|---|
String | NullString | Null String | BlankStrings |
String | UndefString | Undef String | BlankStrings |
String | WhitespaceString | Whitespace String | BlankStrings |
String | HelloString | Hello String | BlankStrings |
WhitespaceString << " "
HelloString << "Hello"
NullString.setState(NULL)
UndefString.setState(UNDEF)
sleep 2
# Get all Strings that start with an H
BlankStrings.select(&:blank?)
.each { |string| logger.info("#{string.id} is blank") }
logger.info("StringOne == 'Hello' is #{StringOne == 'Hello'}")
logger.info("StringOne == 'World' is #{StringOne == 'World'}")
logger.info("StringOne != 'Hello' is #{StringOne != 'Hello'}")
logger.info("StringOne != 'World' is #{StringOne != 'World'}")
logger.info("StringOne == StringTwo is #{StringOne == StringTwo}")
logger.info("StringOne != StringTwo is #{StringOne != StringTwo}")
logger.info("StringOne == StringThree is #{StringOne == StringThree}")
logger.info("StringOne != StringThree is #{StringOne != StringThree}")