From e86a675b95c9ff03b08536fb794828dca5d02cbb Mon Sep 17 00:00:00 2001 From: Ulf Swedin Date: Tue, 25 Jun 2019 22:44:19 +0200 Subject: [PATCH] Added example with one parameter to master branch (#32027) * javascript comments page makeover (english) Remove redundant information Fix link styles Make everything easier to read * Added example with one parameter --- guide/english/csharp/substring/index.md | 7 ++++++- guide/english/javascript/comments/index.md | 5 ++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/guide/english/csharp/substring/index.md b/guide/english/csharp/substring/index.md index 9453e150ff..6461f69f2a 100644 --- a/guide/english/csharp/substring/index.md +++ b/guide/english/csharp/substring/index.md @@ -4,18 +4,22 @@ title: Substring # Substring -`Substring` extracts a portion of a string value. It is used with 2 integer parameters, the first is location of the first character(starts with index 0) and the second is the desired character length. +`Substring` extracts a portion of a string value. It is used with 2 integer parameters, the first is location of the first character(starts with index 0) and the second is the desired character length. If only one parameter is used, it will be the location +of the first character, and the rest of the string is returned from the starting position. ## Example ``` string firstSentence = "Apple, I have."; string secondSentence = "I have a Pen."; +string thirdSentence = "I am having Fun"; string apple = firstSentence.Substring(0,5); string pen = secondSentence.Substring(9,3); +string fun = thirdSentence.Substring(12); Console.WriteLine(apple); Console.WriteLine(pen); +Console.WriteLine(fun) ``` @@ -23,4 +27,5 @@ Console.WriteLine(pen); ``` >Apple >Pen +>Fun ``` diff --git a/guide/english/javascript/comments/index.md b/guide/english/javascript/comments/index.md index 0192469b11..8b6bb41a4e 100644 --- a/guide/english/javascript/comments/index.md +++ b/guide/english/javascript/comments/index.md @@ -64,9 +64,8 @@ hello(); //does not log anything ### Many IDEs come with a keyboard shortcut to comment out lines. 1. Highlight text to be commented -2. Mac: Push `Command`(Apple Key) + `/` - Windows: Push `Control` + `/` -- You can also uncomment code by doing the same steps +2. Mac: Push `Command`(Apple Key) + `/` or Windows: Push `Control` + `/` +3. You can also uncomment code by doing the same steps #### More Information: * [How To Write Comments in JavaScript](https://www.digitalocean.com/community/tutorials/how-to-write-comments-in-javascript)