Logo

Programming-Idioms

History of Idiom 46 > diff from v29 to v30

Edit summary for version 30 by :
New Scala implementation by user [meshelton]

Version 29

2016-02-16, 18:01:28

Version 30

2016-02-16, 21:41:08

Idiom #46 Extract beginning of string (prefix)

Create string t consisting of the 5 first characters of string s.

Idiom #46 Extract beginning of string (prefix)

Create string t consisting of the 5 first characters of string s.

Code
val s = "somestring"
val t = s.take(5)