Skip to content
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

strings.md added in the kotlin folder #1472

Merged
merged 70 commits into from
Jan 11, 2023
Merged
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
e7014e0
added loops.md in kotlin folder
dakshdeepHERE Jan 1, 2023
31dca9a
added more info and a introduction paragraph for loops
dakshdeepHERE Jan 1, 2023
30d2b99
Merge branch 'main' into loops
dakshdeepHERE Jan 2, 2023
fcdd14d
Added data-types.md in the kotlin folder
dakshdeepHERE Jan 2, 2023
5bf7922
Update content/kotlin/concepts/loops/loops.md
dakshdeepHERE Jan 2, 2023
162c7a9
Update content/kotlin/concepts/loops/loops.md
dakshdeepHERE Jan 2, 2023
43b62df
Update content/kotlin/concepts/loops/loops.md
dakshdeepHERE Jan 2, 2023
40eacf3
Update content/kotlin/concepts/loops/loops.md
dakshdeepHERE Jan 2, 2023
48166f2
Update content/kotlin/concepts/loops/loops.md
dakshdeepHERE Jan 2, 2023
22c708d
Update content/kotlin/concepts/loops/loops.md
dakshdeepHERE Jan 2, 2023
5f03889
Update loops.md
dakshdeepHERE Jan 2, 2023
885ea2a
Update loops.md
dakshdeepHERE Jan 2, 2023
d4b2ac2
Merge branch 'Codecademy:main' into loops
dakshdeepHERE Jan 2, 2023
0736dd9
Update loops.md
dakshdeepHERE Jan 2, 2023
b42143f
changed the sequence of for while and do while loops
dakshdeepHERE Jan 2, 2023
f6fd28e
del
dakshdeepHERE Jan 2, 2023
2e70242
Merge branch 'main' into data-types
dakshdeepHERE Jan 2, 2023
c219bc5
changed tags
dakshdeepHERE Jan 4, 2023
a0cec1e
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
28c3525
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
156cbaa
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
9fbd5e6
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
6a49a1c
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
ab6ebff
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
2f1cc3c
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
49b568f
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
7e30fba
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
970a372
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
4974ee0
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
37e863f
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
8f211b0
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
cd47aaa
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
f24382f
Update content/kotlin/concepts/data-types/data-types.md
dakshdeepHERE Jan 4, 2023
ff95ae2
changed the sentence in line 278
dakshdeepHERE Jan 4, 2023
9d8e67a
Update data-types.md
dakshdeepHERE Jan 4, 2023
73e5ae9
added variables.md in kotlin folder
dakshdeepHERE Jan 4, 2023
6a9d6b5
Merge branch 'main' into variables
SSwiniarski Jan 6, 2023
6af23b8
Update content/kotlin/concepts/variables/variables.md
dakshdeepHERE Jan 6, 2023
6381b7b
Update content/kotlin/concepts/variables/variables.md
dakshdeepHERE Jan 6, 2023
664148f
Update content/kotlin/concepts/variables/variables.md
dakshdeepHERE Jan 6, 2023
36081dc
Update content/kotlin/concepts/variables/variables.md
dakshdeepHERE Jan 6, 2023
b5a42f4
Update variables.md
dakshdeepHERE Jan 6, 2023
289286e
Merge branch 'main' of https://github.com/dakshdeepHERE/docs
dakshdeepHERE Jan 7, 2023
7b09c6f
Merge branch 'variables' of https://github.com/dakshdeepHERE/docs
dakshdeepHERE Jan 7, 2023
8152444
del
dakshdeepHERE Jan 7, 2023
cbd9b8f
# This is a combination of 17 commits.
dakshdeepHERE Jan 8, 2023
435aeb6
added strings.md
dakshdeepHERE Jan 8, 2023
d73cfa9
strings.md
dakshdeepHERE Jan 8, 2023
5276242
2
dakshdeepHERE Jan 8, 2023
9ccfd0f
added strings.md in the kotlin folder
dakshdeepHERE Jan 8, 2023
9156296
did the changes that were asked :D
dakshdeepHERE Jan 8, 2023
19bf519
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 10, 2023
d5e06dc
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 10, 2023
6fcd1c8
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 10, 2023
1fe8473
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 10, 2023
8cc3af3
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 10, 2023
6f25a05
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 10, 2023
1e88f8c
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 10, 2023
afd7741
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 10, 2023
dc76d6d
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 10, 2023
2da667f
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 10, 2023
6f8b563
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 10, 2023
21246ef
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 11, 2023
a040b77
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 11, 2023
50242e9
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 11, 2023
4c4dfb6
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 11, 2023
7703ddf
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 11, 2023
763fe08
Update content/kotlin/concepts/strings/strings.md
dakshdeepHERE Jan 11, 2023
bd27e06
added changes
dakshdeepHERE Jan 11, 2023
9e04dc9
Merge branch 'main' into strings
dakshdeepHERE Jan 11, 2023
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
57 changes: 57 additions & 0 deletions content/kotlin/concepts/strings/strings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
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 represent 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

### 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 (`{}`).

## Example

The following example showcases the various ways strings are used in Kotlin:

```kotlin
fun main(args: Array<String>) {
// String literals
val greeting: String = "Hello, World!"
println(greeting)

// String templates
val dynamicValue = 4
val stringOne: String = "The value of dynamicValue is $dynamicValue"
System.out.println(stringOne)

val a = dynamicValue
val b = 5
val stringTwo: String = "The sum of a and b is ${a + b}"
System.out.println(stringTwo)
}
```

The output for the above code will be:

```shell
Hello, World!
dakshdeepHERE marked this conversation as resolved.
Show resolved Hide resolved
The value of dynamicValue is 4
The sum of a and b is 9
dakshdeepHERE marked this conversation as resolved.
Show resolved Hide resolved
```