String comparison

Hi all, i have the line of code that works:-

if(String("Person") == String(TempString.substring(0,5))){ HaveAParty(); }
else{ GoDrownMySorrows(); }

will this work? it compiles, The "String()" around the "person" is needed, but is it needed around the "TempString.substring(0,5)", is this good practice and stops errors, or is it just not needed!?,
AND,
if(String(PersonString) == String(TempString.substring(0,5))){ HaveAParty(); }
else{ GoDrownMySorrows(); }
is the second lot of code needed, or again don't bother?
thanks
Andrew

Moderator edit: Thread title corrected.

You need to understand how String class works. The String() around the "Person" string is a constructor
that makes a String object from a c-string. TempString.substring() is a method call, which returns a String,
your extra call to the String constructor is wasteful and pointless.

Your if can never match as "Person" is of length 6 and can't match a string of length 5.

so a length of string has to be the length of a word excluding the 0 at the start like would be included in an array?,
and, the first if statment is correct, but the "String(PersonString)" is not needed as PersonString is already a string!?
thanks
Andrew

but the "String(PersonString)" is not needed as PersonString is already a string!?

A string and a String are NOT the same thing. What, exactly, are you asking?