Logo

Programming-Idioms

History of Idiom 46 > diff from v41 to v42

Edit summary for version 42 by miguel:
New Kotlin implementation by user [miguel]

Version 41

2019-09-26, 20:23:30

Version 42

2019-09-26, 22:37:33

Idiom #46 Extract beginning of string (prefix)

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

Illustration

Idiom #46 Extract beginning of string (prefix)

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

Illustration
Code
val t = s.take(5)