Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
pp:2026:scala:l06 [2026/03/31 22:56]
ldaniel created
pp:2026:scala:l06 [2026/04/06 16:57] (current)
cata_chiru
Line 1: Line 1:
 ====== Lab 6. For expressions ====== ====== Lab 6. For expressions ======
 +
 +Objectives:
 +  * get familiar with String functions: length, substring, concat, replace
 +  * get familiar with [[https://​docs.scala-lang.org/​overviews/​scala-book/​for-expressions.html|for expressions]] in Scala
 +
  
 ===== 6.1 A small string DSL ===== ===== 6.1 A small string DSL =====
Line 41: Line 46:
  
 <code scala> <code scala>
-scala> "Implement the ''​-''​ operator between two strings that removes occurrences of the second string from the first one:" - "th+scala> "odersky" - "rsk
-val res61: String = Implement e ''​-''​ operator between two strings at removes occurrences of e second string from e first one:+val res61: String = "​odery"​
 </​code>​ </​code>​