mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Adding some strings and docs links
This commit is contained in:
parent
30c29913bd
commit
3f2922d87a
@ -85,6 +85,10 @@ val s = Set(1, 3, 7)
|
|||||||
s(0)
|
s(0)
|
||||||
s(1)
|
s(1)
|
||||||
|
|
||||||
|
/* Look up the documentation of map here - http://www.scala-lang.org/api/current/index.html#scala.collection.immutable.Map
|
||||||
|
* and make sure you can read it
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
// Tuples
|
// Tuples
|
||||||
|
|
||||||
@ -128,9 +132,6 @@ val text = if (x == 10) "yeah" else "nope"
|
|||||||
|
|
||||||
// Object oriented features
|
// Object oriented features
|
||||||
|
|
||||||
class Person
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Case classes
|
// Case classes
|
||||||
|
|
||||||
@ -162,10 +163,32 @@ kate match { case Person("Kate", _) => "Girl"; case Person("George", _) => "Boy"
|
|||||||
|
|
||||||
// Regular expressions
|
// Regular expressions
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
|
||||||
// Strings
|
// Strings
|
||||||
|
|
||||||
|
println("ABCDEF".length)
|
||||||
|
println("ABCDEF".substring(2, 6))
|
||||||
|
println("ABCDEF".replace("C", "3"))
|
||||||
|
|
||||||
|
val n = 45
|
||||||
|
println(s"We have $n apples")
|
||||||
|
|
||||||
|
val a = Array(11, 9, 6)
|
||||||
|
println(s"My second daughter is ${a(2-1)} years old")
|
||||||
|
|
||||||
// Input and output
|
// Input and output
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Further resources
|
||||||
|
|
||||||
|
[Scala for the impatient](http://horstmann.com/scala/)
|
||||||
|
|
||||||
|
[Twitter Scala school(http://twitter.github.io/scala_school/)
|
||||||
|
|
||||||
|
[The scala documentation]
|
||||||
|
|
||||||
|
Join the [Scala user group](https://groups.google.com/forum/#!forum/scala-user)
|
Loading…
Reference in New Issue
Block a user