Jump to content

Substring/Top and tail: Difference between revisions

Line 1,079:
 
=={{header|Swift}}==
Swift strings are native Unicode strings and do not index through the code points. Swift's <code>String.Index</code> refers to true Unicode characters (Unicode grapheme clusters). Swift standard library has generic functionality that not only works with strings, but also with any type that conforms to relevant protocols. The first method presented here uses generic functions from Swift standard library:
 
<lang swift>let txt = "0123456789"
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.