In Scala 2.10 you can use string interpolation.
val height = 1.9d
val name = "James"
println(f"$name%s is $height%2.2f meters tall") // James is 1.90 meters tall
More Related Contents:
- Format a Go string without printing?
- Scala String vs java.lang.String – type inference
- Implementing String.Format() in VB6
- scala string.split does not work
- How to create a formatted String out of a literal in Rust?
- Efficiently repeat a character/string n times in Scala
- How to split a string by a string in Scala
- Why does my string not match when reading user input from stdin?
- What’s the difference of strings within single or double quotes in groovy?
- Difference between text and varchar (character varying)
- Find string between two substrings [duplicate]
- How to format a Java string with leading zero?
- Multiline strings in VB.NET
- formatting long numbers as strings in python
- Case insensitive comparison of strings in shell script
- Convert hex to binary
- Why is capitalizing the first letter of a string so convoluted in Rust?
- How to retrieve two columns data in A,B format in Oracle
- Add separator to string at every N characters?
- String.Format not work in TypeScript
- How can I remove repeated characters in a string with R?
- Best data structure for implementing a dictionary?
- How do I make format! return a &str from a conditional expression?
- Print out elements from an Array with a Comma between the elements
- Check whether a string contains a substring
- What is the equivalent of the join operator over a vector of Strings?
- How do I format a number with a variable number of digits in Python?
- Slicing strings in str.format
- Split bash string by newline characters
- Is there “\n” equivalent in VBscript?