KRL converts a string to lowercase into a pre-block

Question

Is there a way in a pre-block of a rule to convert a string to the whole lower case?

Background

I have a regex that returns parts of a string, and sometimes they start with an uppercase and sometimes not. Since I want to use the result from the regular expression as the key in the hash map, I need the case to always be consistent.

+3
source share
1 answer

Yes! lc()- your friend. Example rule:

rule example {
 select when somedomain someevent
  pre {
    x = "FOO";
    y = x.lc();
  }
  noop();
}

Link to documents: http://docs.kynetx.com/docs/Lc

+2
source

Source: https://habr.com/ru/post/1779291/


All Articles