Skip to content

Commit

Permalink
Trim spaces (dotnet#9777)
Browse files Browse the repository at this point in the history
  • Loading branch information
nxtn authored and BillWagner committed Dec 31, 2018
1 parent 501785d commit 05abaf3
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 74 deletions.
10 changes: 5 additions & 5 deletions _zip/missingapi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### YamlMime:XRefMap
### YamlMime:XRefMap
hrefUpdated: true
references:
- uid: System.Xml.Linq.XElement.Elements*
Expand Down Expand Up @@ -300,7 +300,7 @@ references:
name: OvalShape
name.vb: OvalShape
fullName: Microsoft.VisualBasic.PowerPacks.OvalShape
fullName.vb: Microsoft.VisualBasic.PowerPacks.OvalShape
fullName.vb: Microsoft.VisualBasic.PowerPacks.OvalShape
- uid: Microsoft.VisualBasic.PowerPacks.Printing
href: https://msdn.microsoft.com/library/microsoft.visualbasic.powerpacks.printing.aspx
name: Microsoft.VisualBasic.PowerPacks.Printing
Expand Down Expand Up @@ -516,7 +516,7 @@ references:
name: SetIsVirtualizing
name.vb: SetIsVirtualizing
fullName: VirtualizingStackPanel.SetIsVirtualizing
fullName.vb: VirtualizingStackPanel.SetIsVirtualizing
fullName.vb: VirtualizingStackPanel.SetIsVirtualizing
- uid: System.Windows.Localization.Attributes*
href: https://msdn.microsoft.com/library/system.windows.localization.attributes.aspx
name: Attributes
Expand Down Expand Up @@ -546,7 +546,7 @@ references:
name: IsVisualHostMaterial
name.vb: IsVisualHostMaterial
fullName: Viewport2DVisual3D.IsVisualHostMaterial
fullName.vb: TimeViewport2DVisual3Dline.IsVisualHostMaterial
fullName.vb: TimeViewport2DVisual3Dline.IsVisualHostMaterial
- uid: System.Windows.Navigation.BaseUriHelper.BaseUri*
href: https://msdn.microsoft.com/library/system.windows.navigation.baseurihelper.baseuri.aspx
name: BaseUri
Expand Down Expand Up @@ -600,4 +600,4 @@ references:
name: XlRangeAutoFormat
name.vb: XlRangeAutoFormat
fullName: Microsoft.Office.Interop.Excel.XlRangeAutoFormat
fullName.vb: Microsoft.Office.Interop.Excel.XlRangeAutoFormat
fullName.vb: Microsoft.Office.Interop.Excel.XlRangeAutoFormat
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ install:
build_script:
# dotnet info
- ps: dotnet --info
# Run dotnet new
# Run dotnet new
- ps: mkdir "test\test-dotnet-new" -Force | Push-Location
- ps: dotnet new console -lang f#
- ps: dotnet restore
Expand All @@ -25,5 +25,5 @@ build_script:
- ps: Pop-Location


test: off
test: off
version: 0.0.1.{build}
34 changes: 17 additions & 17 deletions docs/csharp/tutorials/intro-to-csharp/branches-and-loops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ items:
Console.WriteLine("The answer is greater than 10.");
```
Modify the declaration of `b` so that the sum is less than 10:
Modify the declaration of `b` so that the sum is less than 10:
```csharp
int b = 3;
Expand All @@ -42,9 +42,9 @@ items:
> find those errors and report them to you. When the output
> contains error messages, look closely at the example code,
> and the code in the interactive window to see what to fix.
> That exercise will help you learn the structure of C# code.
> That exercise will help you learn the structure of C# code.
This first sample shows the power of `if` and boolean types. A *boolean* is a variable that can have one of two values: `true` or `false`. C# defines a special type, `bool` for boolean variables. The `if` statement checks the value of a `bool`. When the value is `true`, the statement following the `if` executes. Otherwise, it is skipped.
This first sample shows the power of `if` and boolean types. A *boolean* is a variable that can have one of two values: `true` or `false`. C# defines a special type, `bool` for boolean variables. The `if` statement checks the value of a `bool`. When the value is `true`, the statement following the `if` executes. Otherwise, it is skipped.
This process of checking conditions and executing statements based on those conditions is very powerful. Let's explore more.
Expand All @@ -54,8 +54,8 @@ items:
- title: Make if and else work together
durationInMinutes: 10
content: |
To execute different code in both the true and false branches, you
To execute different code in both the true and false branches, you
create an `else` branch that executes when the condition is false. Try this:
```csharp
Expand All @@ -68,10 +68,10 @@ items:
```
The statement following the `else` keyword executes only when the condition being tested is `false`. Combining `if` and `else` with boolean conditions provides all the power you need.
> [!IMPORTANT]
> The indentation under the `if` and `else` statements is for human readers.
> The C# language doesn't treat indentation or white space as significant.
> The C# language doesn't treat indentation or white space as significant.
> The statement following the `if` or `else` keyword will be executed based
> on the condition. All the samples in this tutorial follow a common
> practice to indent lines based on the control flow of statements.
Expand Down Expand Up @@ -116,11 +116,11 @@ items:
Console.WriteLine("Or the first number is not greater than the second");
}
```
The `&&` represents "and". It means both conditions must be true to execute
the statement in the true branch. These examples also show that you can have multiple
statements in each conditional branch, provided you enclose them in `{` and `}`.
You can also use `||` to represent "or":
```csharp
Expand Down Expand Up @@ -174,7 +174,7 @@ items:
> code will time out and you'll see no output from your program.
The `while` loop tests the condition before executing the code
following the `while`. The `do` ... `while` loop executes the
following the `while`. The `do` ... `while` loop executes the
code first, and then checks the condition. It looks like this:
```csharp
Expand All @@ -185,9 +185,9 @@ items:
counter++;
} while (counter < 10);
```
This `do` loop and the earlier `while` loop work the same.
This `do` loop and the earlier `while` loop work the same.
Let's move on to one last loop statement.
> [!NOTE]
Expand All @@ -203,12 +203,12 @@ items:
for(int counter = 0; counter < 10; counter++)
{
Console.WriteLine($"Hello World! The counter is {counter}");
}
}
```
This does the same work as the `while` loop and the `do` loop you've
already used. The `for` statement has three parts that control
how it works.
how it works.
The first part is the **for initializer**: `int counter = 0;` declares
that `counter` is the loop variable, and sets its initial value to `0`.
Expand Down Expand Up @@ -238,7 +238,7 @@ items:
constructs in the C# language, see if you can write C# code to
find the sum of all integers 1 through 20 that are divisible
by 3. Here are a few hints:
- The `%` operator gives you the remainder of a division operation.
- The `if` statement gives you the condition to see if a number should be part of the sum.
- The `for` loop can help you repeat a series of steps for all the numbers 1 through 20.
Expand Down Expand Up @@ -271,7 +271,7 @@ items:
- title: Congratulations!
content: |
You've completed the "branches and loops" interactive tutorial. You can click the **Interpolated strings** link below to start the next interactive tutorial, or you can visit the [.NET site](https://www.microsoft.com/net/learn/dotnet/hello-world-tutorial) to download the .NET Core SDK, create a project on your machine, and keep coding. The "Keep Learning" step brings you back to these tutorials.
You can learn more about these concepts in these topics:
- [If and else statement](../../language-reference/keywords/if-else.md)
Expand Down
20 changes: 10 additions & 10 deletions docs/csharp/tutorials/intro-to-csharp/hello-world.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ items:
Congratulations! You've run your first C# program. It's a simple program that prints the message "Hello World!". It used the <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> method to print that message. `Console` is a type that represents the console window. `WriteLine` is a method of the `Console` type that prints a line of text to that text console.
Let's move on and explore more. The rest of this lesson explores working with the `string` type, which represents text in C#. Like the `Console` type, the `string` type has methods. The `string` methods work with text.
Let's move on and explore more. The rest of this lesson explores working with the `string` type, which represents text in C#. Like the `Console` type, the `string` type has methods. The `string` methods work with text.
> [!NOTE]
> This online coding experience is in preview mode. If you encounter problems, please report them [on the dotnet/try repo](https://github.com/dotnet/try/issues).
Expand All @@ -35,15 +35,15 @@ items:
durationInMinutes: 3
content: |
Your first program printed the `string` "Hello World!" on
the screen.
the screen.
> [!TIP]
> As you explore C# (or any programming language), you'll
> make mistakes when you write code. The **compiler** will
> find those errors and report them to you. When the output
> contains error messages, look closely at the example code,
> and the code in the interactive window to see what to fix.
> That exercise will help you learn the structure of C# code.
> That exercise will help you learn the structure of C# code.
Your first program is limited to printing one message. You can write more
useful programs by using **variables**. A **variable** is a symbol you can
Expand Down Expand Up @@ -81,7 +81,7 @@ items:
You've been using `+` to build strings from **variables** and **constant** strings. There's a better way.
You can place a variable between `{` and `}` characters to tell C# to replace that text with the value of the variable.
This is called [String interpolation](../../language-reference/tokens/interpolated.md).
If you add a `$` before the opening quote of the string, you can then include variables, like `aFriend`, inside the string between curly braces. Give it a try:
Expand Down Expand Up @@ -129,8 +129,8 @@ items:
- title: Do more with strings
durationInMinutes: 5
content: |
You've been using a **method**, <xref:System.Console.WriteLine%2A?displayProperty=nameWithType>, to print messages. A **method** is a block of code that implements some action. It has a name, so you can access it.
You've been using a **method**, <xref:System.Console.WriteLine%2A?displayProperty=nameWithType>, to print messages. A **method** is a block of code that implements some action. It has a name, so you can access it.
Suppose your strings have leading or trailing spaces that you don't want to display. You want to **trim** the spaces from the strings.
The <xref:System.String.Trim%2A> method and related methods <xref:System.String.TrimStart%2A> and <xref:System.String.TrimEnd%2A> do that work. You can just use those methods to remove leading and trailing spaces. Try the following code:
Expand Down Expand Up @@ -198,7 +198,7 @@ items:
> Watch your punctuation when you test for the text at the end of the string. If the string
> ends with a period, you must check for a string that ends with a period.
You should get `true` for starting with "You" and ending with "hello" and false for starting with or ending with "goodbye".
You should get `true` for starting with "You" and ending with "hello" and false for starting with or ending with "goodbye".
> [!NOTE]
> This online coding experience is in preview mode. If you encounter problems, please report them [on the dotnet/try repo](https://github.com/dotnet/try/issues).
Expand All @@ -219,10 +219,10 @@ items:
> [!NOTE]
> This online coding experience is in preview mode. If you encounter problems, please report them [on the dotnet/try repo](https://github.com/dotnet/try/issues).
- content: |
You've completed the "Hello C#" introduction to C# tutorial. You can click the **Numbers in C#** link below to start the next interactive tutorial, or you can visit the [.NET site](https://www.microsoft.com/net/learn/dotnet/hello-world-tutorial) to download the .NET Core SDK, create a project on your machine, and keep coding. The "Keep Learning" step brings you back to these tutorials.
For further reading on the `string` type:
- [C# Programming Guide](../../programming-guide/index.md) topic on [strings](../../programming-guide/strings/index.md).
- [C# Programming Guide](../../programming-guide/index.md) topic on [strings](../../programming-guide/strings/index.md).
- [How to tips on working with strings](../../how-to/index.md#working-with-strings).
Loading

0 comments on commit 05abaf3

Please sign in to comment.