How can i print word like this -> Hello World ...
# getting-started
m
How can i print word like this -> Hello World in terminal? using kotlin
j
Actually, this is not related to Kotlin, you just have to use espace characters: https://askubuntu.com/a/643578
m
thx for the reply it still bothering me. if i do echo "\e[9mstrikethrough\e[0m" output : strikethrough but if i do println("\\e[9mstrikethrough\\e[0m" ) output : \e[9mstrikethrough\e[0m
k
In Bash, you have to use
echo -e "\e[9mstrikethrough\e[0m"
- where the
-e
option makes the command interpret
\e
as the ESC character. In Kotlin, you have to be more specific as
"\e"
is a syntax error:
Copy code
println("\u001B[9mstrikethrough\u001B[0m")
(The ESC character is Unicode code point 001B)
m
it work thank you soo much😁