StrComp


Definition: Returns a value indicating the result of a string comparison.

 

Can we tell you whether two strings or identical? We can, provided you tell us one thing: do you want a case-sensitive comparison or a case-insensitive comparison?

Let’s try a case-insensitive comparison for starters. In the following set of commands we assign values to variables $ a and$b. We then use the System.Stringclass and the Compare( )method to compare the two strings. Note that we pass the Compare() method three parameters: the two strings to be compared, and the value $True, which indicates that we want to do a case-insensitive comparison:

 

$a = "dog"
$b = "DOG"
$c = [String]: :Compare($ a,$b,$True)

 

When you run this command and then echo back the value of $c you should get the following:

 

0

 

Note. A 0 means that the strings are identical.Any other value means that the strings are notidentical.

 

Of course, these strings are identical because we did a case-insensitive comparison. Suppose we use thiscommand, which does a case –sensitive comparison:

 

$c = [String]: :Compare($ a,$b,$False)

 

This time you get back -1, meaning that the strings are notidentical (because the letter cases are not the same).

 

 

 

 

500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@systemmanager.forsenergy.ru to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.