<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>You should be able to use ==.&nbsp;</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">Are the lengths of your strings the same length? readLine() has a strip newlines parameter that is true by default.&nbsp;</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">Best,</div><div id="AppleMailSignature">Austin<br><br>Sent from my iPhone</div><div><br>On Jun 2, 2016, at 12:07 PM, John Myers via swift-users &lt;<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">I've had some difficulty comparing string variables to string constants with ==.&nbsp; I believe it's always after using a readLine().&nbsp; Does Swift require a .equals() or a .compareTo(), as other c like languages, or are there invisible characters in my string because of the readLine() which I need to strip out?<br clear="all"><div>Thanks!</div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">John Myers<div>------------------------------------------------------------------<br></div><div><a href="mailto:myersj@shawanoschools.com" target="_blank">myersj@shawanoschools.com</a></div><div><br></div></div></div>
</div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-users mailing list</span><br><span><a href="mailto:swift-users@swift.org">swift-users@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-users">https://lists.swift.org/mailman/listinfo/swift-users</a></span><br></div></blockquote></body></html>