Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/csharp/how-to/parse-strings-using-split.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ The <xref:System.String.Split*?displayProperty=nameWithType> has many overloads.

The remaining examples use different overloads to show each of these behaviors.

For more information about indices, see the [Explore indexes and ranges](../tutorials/ranges-indexes.md) article.

## Specify multiple separators

<xref:System.String.Split%2A?displayProperty=nameWithType> can use multiple separator characters. The following example uses spaces, commas, periods, colons, and tabs as separating characters, which are passed to <xref:System.String.Split%2A> in an array. The loop at the bottom of the code displays each of the words in the returned array.
Expand Down
2 changes: 2 additions & 0 deletions docs/csharp/language-reference/builtin-types/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ A *single-dimensional array* is a sequence of like elements. You access an eleme

The first declaration declares an uninitialized array of five integers, from `array[0]` to `array[4]`. The elements of the array are initialized to the [default value](default-values.md) of the element type, `0` for integers. The second declaration declares an array of strings and initializes all seven values of that array. A series of `Console.WriteLine` statements prints all the elements of the `weekDay` array. For single-dimensional arrays, the `foreach` statement processes elements in increasing index order, starting with index 0 and ending with index `Length - 1`.

For more information about indices, see the [Explore indexes and ranges](../../tutorials/ranges-indexes.md) article.

### Pass single-dimensional arrays as arguments

You can pass an initialized single-dimensional array to a method. In the following example, an array of strings is initialized and passed as an argument to a `DisplayArray` method for strings. The method displays the elements of the array. Next, the `ChangeArray` method reverses the array elements, and then the `ChangeArrayElements` method modifies the first three elements of the array. After each method returns, the `DisplayArray` method shows that passing an array by value doesn't prevent changes to the array elements.
Expand Down
2 changes: 2 additions & 0 deletions docs/csharp/language-reference/builtin-types/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ For the type of elements in the <xref:System.Collections.Generic.List%601>, you

:::code language="csharp" source="./snippets/shared/Collections.cs" id="SnippetCustomList":::

For more information about indices, see the [Explore indexes and ranges](../../tutorials/ranges-indexes.md) article.

## Key/value pair collections

These examples use the <xref:System.Collections.Generic.Dictionary%602> class. It's the most common dictionary collection. A dictionary collection enables you to access elements in the collection by using the key of each element. Each addition to the dictionary consists of a value and its associated key.
Expand Down
2 changes: 2 additions & 0 deletions docs/csharp/programming-guide/strings/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ If the <xref:System.String> methods don't provide the functionality that you mus

:::code language="csharp" source="./snippets/StringCharacters.cs" id="AccessChars":::

For more information about indices, see the [Explore indexes and ranges](../../tutorials/ranges-indexes.md) article.

## Null strings and empty strings

An empty string is an instance of a <xref:System.String?displayProperty=nameWithType> object that contains zero characters. Empty strings are used often in various programming scenarios to represent a blank text field. You can call methods on empty strings because they're valid <xref:System.String?displayProperty=nameWithType> objects. Empty strings are initialized as follows:
Expand Down
2 changes: 2 additions & 0 deletions docs/csharp/tour-of-csharp/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ You can use *index* and *range* expressions to retrieve one or more elements fro

The `^` index indicates *from the end* rather than from the start. The `^0` element is one past the end of the collection, so `^1` is the last element. The `..` in a range expression denotes the range of elements to include. The range starts with the first index and includes all elements up to, but not including, the element at the last index.

For more information about index and range expressions, see the [Explore indexes and ranges](../tutorials/ranges-indexes.md) article.

[Language integrated query (LINQ)](../linq/index.md) provides a common pattern-based syntax to query or transform any collection of data. LINQ unifies the syntax for querying in-memory collections, structured data like XML or JSON, database storage, and even cloud based data APIs. You learn one set of syntax and you can search and manipulate data regardless of its storage. The following query finds all students whose grade point average is greater than 3.5:

:::code language="csharp" source="./snippets/shared/LinqExample.cs" id="LinqExampleQuery":::
Expand Down
2 changes: 2 additions & 0 deletions docs/csharp/tour-of-csharp/tutorials/list-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ You're not allowed to access past the end of the list. You can check how long th

Select **Run** again to see the results. In C#, indices start at 0, so the largest valid index is one less than the number of items in the list.

For more information about indices, see the [Explore indexes and ranges](../../tutorials/ranges-indexes.md) article.

## Search and sort lists

Our samples use relatively small lists, but your applications might often create lists with many more elements, sometimes numbering in the thousands. To find elements in these larger collections, you need to search the list for different items. The <xref:System.Collections.Generic.List%601.IndexOf%2A> method searches for an item and returns the index of the item. If the item isn't in the list, `IndexOf` returns `-1`. Try it to see how it works. Add the following code after what you wrote so far:
Expand Down
Loading