Answers for "format string kotlin"

4

format string kotlin

val str1 = String.format("%d", 404) // Integer value  
 val str2 = String.format("%s", "Mehmet") // String value  
 val str3 = String.format("%f", 404.00) // Float value  
 val str4 = String.format("%x", 404) // Hexadecimal value  
 val str5 = String.format("%c", 'c') // Char value  
 println(str1)
 println(str2)
 println(str3)
 println(str4)
 println(str5)
Posted by: Guest on July-28-2021

Browse Popular Code Answers by Language