-
Notifications
You must be signed in to change notification settings - Fork 4.1k
strings.md added in the kotlin folder #1472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 62 commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
e7014e0
added loops.md in kotlin folder
dakshdeepHERE 31dca9a
added more info and a introduction paragraph for loops
dakshdeepHERE 30d2b99
Merge branch 'main' into loops
dakshdeepHERE fcdd14d
Added data-types.md in the kotlin folder
dakshdeepHERE 5bf7922
Update content/kotlin/concepts/loops/loops.md
dakshdeepHERE 162c7a9
Update content/kotlin/concepts/loops/loops.md
dakshdeepHERE 43b62df
Update content/kotlin/concepts/loops/loops.md
dakshdeepHERE 40eacf3
Update content/kotlin/concepts/loops/loops.md
dakshdeepHERE 48166f2
Update content/kotlin/concepts/loops/loops.md
dakshdeepHERE 22c708d
Update content/kotlin/concepts/loops/loops.md
dakshdeepHERE 5f03889
Update loops.md
dakshdeepHERE 885ea2a
Update loops.md
dakshdeepHERE d4b2ac2
Merge branch 'Codecademy:main' into loops
dakshdeepHERE 0736dd9
Update loops.md
dakshdeepHERE b42143f
changed the sequence of for while and do while loops
dakshdeepHERE f6fd28e
del
dakshdeepHERE 2e70242
Merge branch 'main' into data-types
dakshdeepHERE c219bc5
changed tags
dakshdeepHERE a0cec1e
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE 28c3525
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE 156cbaa
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE 9fbd5e6
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE 6a49a1c
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE ab6ebff
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE 2f1cc3c
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE 49b568f
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE 7e30fba
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE 970a372
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE 4974ee0
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE 37e863f
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE 8f211b0
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE cd47aaa
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE f24382f
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE ff95ae2
changed the sentence in line 278
dakshdeepHERE 9d8e67a
Update data-types.md
dakshdeepHERE 73e5ae9
added variables.md in kotlin folder
dakshdeepHERE 6a9d6b5
Merge branch 'main' into variables
SSwiniarski 6af23b8
Update content/kotlin/concepts/variables/variables.md
dakshdeepHERE 6381b7b
Update content/kotlin/concepts/variables/variables.md
dakshdeepHERE 664148f
Update content/kotlin/concepts/variables/variables.md
dakshdeepHERE 36081dc
Update content/kotlin/concepts/variables/variables.md
dakshdeepHERE b5a42f4
Update variables.md
dakshdeepHERE 289286e
Merge branch 'main' of https://github.com/dakshdeepHERE/docs
dakshdeepHERE 7b09c6f
Merge branch 'variables' of https://github.com/dakshdeepHERE/docs
dakshdeepHERE 8152444
del
dakshdeepHERE cbd9b8f
# This is a combination of 17 commits.
dakshdeepHERE 435aeb6
added strings.md
dakshdeepHERE d73cfa9
strings.md
dakshdeepHERE 5276242
2
dakshdeepHERE 9ccfd0f
added strings.md in the kotlin folder
dakshdeepHERE 9156296
did the changes that were asked :D
dakshdeepHERE 19bf519
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE d5e06dc
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE 6fcd1c8
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE 1fe8473
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE 8cc3af3
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE 6f25a05
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE 1e88f8c
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE afd7741
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE dc76d6d
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE 2da667f
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE 6f8b563
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE 21246ef
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE a040b77
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE 50242e9
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE 4c4dfb6
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE 7703ddf
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE 763fe08
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE bd27e06
added changes
dakshdeepHERE 9e04dc9
Merge branch 'main' into strings
dakshdeepHERE File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
Title: 'Strings' | ||
Description: 'Strings are immutable objects that are sequences of characters contained within a pair of double quotes.' | ||
Subjects: | ||
- 'Computer Science' | ||
Tags: | ||
- 'Strings' | ||
- 'Data Types' | ||
- 'Characters' | ||
CatalogContent: | ||
- 'learn-kotlin' | ||
- 'paths/computer-science' | ||
--- | ||
|
||
**Strings** are immutable objects that represents a sequence of characters contained within double quotes (`""`). | ||
|
||
## Syntax | ||
|
||
```pseudo | ||
val stringName: String = "string value" | ||
``` | ||
|
||
dakshdeepHERE marked this conversation as resolved.
Show resolved
Hide resolved
|
||
In Kotlin, string values are always defined as instances of the `String` class. | ||
dakshdeepHERE marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## Example | ||
|
||
Here is an example of how you might use strings in Kotlin: | ||
dakshdeepHERE marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```kotlin | ||
fun main(args: Array<String>) { | ||
val greeting: String = "Hello, World!" | ||
println(greeting) | ||
} | ||
dakshdeepHERE marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
The output for the above code will be: | ||
|
||
```shell | ||
Hello, World! | ||
dakshdeepHERE marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
## String Templates | ||
|
||
Templates can also be used to dynamically produce string values. Dynamic values don't have to start as strings, and can either be directly referenced with a dollar sign (`$`) or evaluated as a string with additional curly braces (`{}`). The following showcases both techniques: | ||
|
||
```kotlin | ||
val dynamicValue = 4 | ||
val stringOne: String = "The value of dynamicValue is $dynamicValue" | ||
System.out.println(stringOne) | ||
|
||
val a = 4 | ||
val b = 5 | ||
val stringTwo: String = "The sum of a and b is ${a + b}" | ||
System.out.println(stringTwo) | ||
``` | ||
|
||
This will print the following output: | ||
|
||
```shell | ||
The value of dynamicValue is 4 | ||
The sum of a and b is 9 | ||
dakshdeepHERE marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
dakshdeepHERE marked this conversation as resolved.
Show resolved
Hide resolved
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.