How can I convert my Kotlin Array
to a varargs Java String[]
?
val angularRoutings =
arrayOf<String>("/language", "/home")
// this doesn't work
web.ignoring().antMatchers(angularRoutings)
How can I convert my Kotlin Array
to a varargs Java String[]
?
val angularRoutings =
arrayOf<String>("/language", "/home")
// this doesn't work
web.ignoring().antMatchers(angularRoutings)
You should use the "spread operator", which looks like this:
*
The spread operator needs to be prefixed to the array argument:
For further information, see the documentation: