Compare string with speed
Considering the following piece of code in the speed pattern:
#set($brandName = $player.brand.name)
#set($brandNameExample = "NameExample")
#if($brandName == $brandNameExample)
11111
#else
22222
#end
I always get 22222
. Of course player.brand.name = "NameExample"
.
Can someone explain to me why and how to get it to work?
+3
source to share
2 answers
I would recommend testing this
#set($brandName = "NameExample")
#set($brandNameExample = "NameExample")
#if($brandName == $brandNameExample)
11111
#else
22222
#end
if it works then i will try to output $ player, $ player.brand, $ player.brand.name you need to make sure $ player.brand.name is storing the correct value. - case sensitivity? - Make sure "$ player.brand.name" is spelled correctly?
I think you just have a problem in the $ player object
+2
source to share