<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 30, 2017, at 9:48 PM, Taylor Swift via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><span class=""></span>Swift's strings were very deliberately designed this way. It's tougher to get off the ground, sure, but it's better in the long run.<span class="HOEnZb"></span></div>
<br class=""></blockquote></div><br class=""></div><div class="gmail_extra">It probably is, but the correct idiom is not very well known, and sadly most tutorials and unofficial guides are still teaching dumb ways of subscripting into strings (or worse, falling back into NSString methods without mentioning so) so the end result is people writing less performant code rather than more performant code.<br class=""></div></div></div></blockquote><div><br class=""></div>An efficient solution doesn’t help if even experienced programmers can’t easily arrive at it. &nbsp;(I’m highly experienced, but I’ll admit I only put in about 5 minutes before I posted that. &nbsp;on the other hand, it shouldn’t take 5 minutes to figure out something that simple with strings. &nbsp;still, maybe i would have done the simple “suffix()” thing had i been looking at the actual swift 4 api’s, but i only had swift 3 api’s in front of me.)</div><div><br class=""><blockquote type="cite" class=""><div class="">
_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></body></html>