Home > Net >  Help me to solve the code, what on earth is this, this is what meaning ah
Help me to solve the code, what on earth is this, this is what meaning ah

Time:04-03

Return a. ength & gt; 0? A.S ubstring (0, a. ength) : a;

CodePudding user response:

A. ength> 0 return a value?

CodePudding user response:

This and return a directly; What's the difference?

CodePudding user response:

//can be translated into the following code
If (a. ength & gt; 0)//if the length of a greater than 0
{
Return a.S ubstring (0, a. ength);//return (starting from the index 0, intercept a total length of the substring, isn't that a itself! Redundant)
}
The else
{
return a;//returns a
}

//this is a junk code no matter what the results returned are a, can be directly replaced by return a;

CodePudding user response:

CodePudding user response:

CodePudding user response:

Does your company pay is count and code characters hook?

CodePudding user response:

The writing a little cow force, meaning directly come back

CodePudding user response:

This clearly is superstitious blog posts written by gadgets

Some post will write "oh my god, Microsoft to hurt me, String. IsNullOrEmpty has serious bugs, we don't use, must not use, three times and preach Jesus Christ."

CodePudding user response:

Because there is what they call "\ 0" null, Empty, WhiteSpace, etc all kinds of serious big bug
  •  Tags:  
  • C#
  • Related