Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
if( !( key==new string(key.ToCharArray()? key : null ) == new String(key.ToArray<char>()) )
I had to open VS and read the string documentation in order to make sure it works.
It works. Beat THAT! -
loopback5736y@Gregozor2121 you could always be more verbose!
boolean isEqual = true;
for ( char c : key.toCharArray() )
{
for (char c1 : key.toCharArray() )
{
if( c != c1 )
{
isEqual = false;
break;
}
}
}
I've seen something very similar in production code.... -
Omarzion956yif (key
&& typeof key === 'string'
&& key.length
&& key.split('').reduce((eq, c, i) => eq && c === key[i], true)
) -
Never trust a string. Never.
let firstKey = key.toString();
let secondKey = key.toString();
if(typeof firstKey === typeof secondKey && firstKey === secondKey) {
if(firstKey.contains(secondKey) {
return (!(true !== false)) == false;
}
}
return !true;
Related Rants
-
linuxxx30A client asked if we could change their nameservers to wix's ones. "we want to move to wix because one of my...
-
PieInOblivion5Teacher: "Whats that key thingy?" Class: "You mean the keyboard?" Teacher: "Yes, that one!" I shit you not, s...
-
karmak5I have a bug. I have a solution. I was wrong. I still have a bug. I repeat.
I have my doubts of being a good developer when my fingers type this thing
Just checking if a string contains itself
rant
i'm tired
need some rest
go home me
send help