https://kotlinlang.org logo
#announcements
Title
# announcements
c

Czar

09/04/2017, 7:54 AM
Something like
Copy code
when (testString) {
    myRegex -> //do something
    //...
}
k

karelpeeters

09/04/2017, 11:07 AM
No, you can't directly. You could go with the other type of
when
of course:
Copy code
when {
    regex.matches(testString) -> ...
    ...
}
c

Czar

09/04/2017, 1:15 PM
Yes, that's what I have, just was interested if there is some builtin support with when (testString). Thanks for confirmation.