Friday, February 10, 2012

4.4.4. Extracting a substring

We can get some of the contents of a string with "substring", which takes two parameters: the position from which we start and how many characters we want to obtain. The result will be another string:

greeting = sentence.Substring(0,4);

We can omit the second number, and then we will get from that position shown to the end of the string.

No comments:

Post a Comment