This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
s1 = "ABCDEF".mid(1,3) | |
s2 = "DEFABC".mid(4,6) | |
writeOutput(s1 & "<br>") // ABC | |
writeOutput(s2 & "<br>") // ABC | |
writeOutput("<br>") | |
writeOutput((s1 == s2) & "<br>") // true | |
writeOutput((s1 === s2) & "<br>") // true (FALSE ON LUCEE) | |
writeOutput("<br>") | |
s3 = "ABC" | |
s4 = "ABC" | |
writeOutput((s3 == s4) & "<br>") // true | |
writeOutput((s3 === s4) & "<br>") // true | |
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s1 = "DEFABC".substring(3,6) | |
s2 = "ABCDEF".substring(0,3) | |
println s1 // ABC | |
println s2 // ABC | |
println "" | |
println s1 == s2 // true | |
println s1 === s2 // false | |
println "" | |
s3 = "ABC" | |
s4 = "ABC" | |
println s3 == s4 // true | |
println s3 === s4 // true | |
println s3.is(s4) // true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s1 = "ABCDEF".substring(0,3) | |
s2 = "DEFABC".substring(3,6) | |
console.log(s1) // ABC | |
console.log(s2) // ABC | |
console.log("") | |
console.log(s1 == s2) // true | |
console.log(s1 === s2) // true | |
console.log("") | |
s3 = "ABC" | |
s4 = "ABC" | |
console.log(s3 == s4) // true | |
console.log(s3 === s4) // true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
val s1 = "DEFABC".substring(3,6) | |
val s2 = "ABCDEF".substring(0,3) | |
println(s1) // ABC | |
println(s2) // ABC | |
println("") | |
println(s1 == s2) // true | |
println(s1 === s2) // false | |
println("") | |
val s3 = "ABC" | |
val s4 = "ABC" | |
println(s3 == s4) // true | |
println(s3 === s4) // true | |
println(s3.equals(s4)) // true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s1 = "ABCDEF"[0:3] | |
s2 = "DEFABC"[3:6] | |
print(s1) # ABC | |
print(s2) # ABC | |
print("") | |
print(s1 == s2) # True | |
print(s1 is s2) # False | |
print("") | |
s3 = "ABC" | |
s4 = "ABC" | |
print(s3 == s4) # True | |
print(s3 is s4) # True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s1 = "ABCDEF"[0..2] | |
s2 = "DEFABC"[3..6] | |
puts s1 # ABC | |
puts s2 # ABC | |
puts "" | |
puts s1 == s2 # true | |
puts s1 === s2 # true | |
puts "" | |
s3 = "ABC" | |
s4 = "ABC" | |
puts s3 == s4 # true | |
puts s3 === s4 # true | |
puts s3.equal?(s4) # false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment