How to pass vargar argument to String.format in Kotlin?
I'm not able to find how to pass a vararg argument directly to another function (String.format) that takes also a vararg argument.
I have a method in which I want to call String.format with variable arguments:
fun execute(userId: UserId, action: Action, vararg arg: Int){
dataRepository.logAction(userId, String.format(action.log, arg))
}
action.log can be for example "text: %d".
And I'm calling the function like that:
execute(UUID.randomId(), Action.MyAction, 13)
I'm not able to...