mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-12 17:54:26 +02:00
Minor consistency edit
This commit is contained in:
@@ -104,11 +104,12 @@ true == false // false
|
|||||||
|
|
||||||
// Strings have the usual Java methods defined on them
|
// Strings have the usual Java methods defined on them
|
||||||
"hello world".length
|
"hello world".length
|
||||||
"ABCDEF".substring(2, 6)
|
"hello world".substring(2, 6)
|
||||||
"ABCDEF".replace("C", "3")
|
"hello world".replace("C", "3")
|
||||||
|
|
||||||
// They also have some extra Scala methods. See also: scala.collection.immutable.StringOps
|
// They also have some extra Scala methods. See also: scala.collection.immutable.StringOps
|
||||||
"hello world".take(5)
|
"hello world".take(5)
|
||||||
|
"hello world".drop(5)
|
||||||
|
|
||||||
// String interpolation: notice the prefix "s"
|
// String interpolation: notice the prefix "s"
|
||||||
val n = 45
|
val n = 45
|
||||||
|
Reference in New Issue
Block a user