I am trying to pass a function to a function in Kotlin here is my code.
fun validateValueWithFunc(value: String, parsefun: (CharSequence) -> Boolean, type: String){
if(parsefun(value))
print("Valid ${type}")
else
print("Invalid ${type}")
}
The function I'm passing is from Regex class "containsMatchIn"
val f = Regex.fromLiteral("some regex").containsMatchIn
I know about the :: function reference operator but I don't know how to use it in this situation