C#: A Detailed Approach to Practical Coding (Step-By-Step C# Book 2) by Nathan Clark

C#: A Detailed Approach to Practical Coding (Step-By-Step C# Book 2) by Nathan Clark

Author:Nathan Clark [Clark, Nathan]
Language: eng
Format: azw3
Publisher: Nathan Clark
Published: 2017-11-25T05:00:00+00:00


class Program

{

// The main function

static void Main(string[] args)

{

// Defining a string

string a = "Hello ";

Console.WriteLine("The value of the string is " + a.TrimEnd());

Console.Read();

}

}

}

With this program, the output is as follows:

The value of the string is Hello

6.17 CompareTo Function

This compares an instance with a specified string, and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified string.

If the value is less than zero it means that the destination string precedes the value.

If the value is greater than zero it means that the destination string follows the value.

If the value is zero then this instance has the same position in the sort order as the value.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.