Skip to content

Commit 80094ba

Browse files
dakshdeepHERESSwiniarskiyangc95Dusch4593
authored
strings.md added in the kotlin folder (#1472)
* added loops.md in kotlin folder * added more info and a introduction paragraph for loops * Added data-types.md in the kotlin folder * Update content/kotlin/concepts/loops/loops.md Co-authored-by: SSwiniarski <[email protected]> * Update content/kotlin/concepts/loops/loops.md Co-authored-by: SSwiniarski <[email protected]> * Update content/kotlin/concepts/loops/loops.md Co-authored-by: SSwiniarski <[email protected]> * Update content/kotlin/concepts/loops/loops.md Co-authored-by: SSwiniarski <[email protected]> * Update content/kotlin/concepts/loops/loops.md Co-authored-by: SSwiniarski <[email protected]> * Update content/kotlin/concepts/loops/loops.md Co-authored-by: SSwiniarski <[email protected]> * Update loops.md * Update loops.md * Update loops.md * changed the sequence of for while and do while loops * del * changed tags * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * Update content/kotlin/concepts/data-types/data-types.md Co-authored-by: Christine Yang <[email protected]> * changed the sentence in line 278 * Update data-types.md * added variables.md in kotlin folder * Update content/kotlin/concepts/variables/variables.md Co-authored-by: SSwiniarski <[email protected]> * Update content/kotlin/concepts/variables/variables.md Co-authored-by: SSwiniarski <[email protected]> * Update content/kotlin/concepts/variables/variables.md Co-authored-by: SSwiniarski <[email protected]> * Update content/kotlin/concepts/variables/variables.md Co-authored-by: SSwiniarski <[email protected]> * Update variables.md * del * added strings.md * strings.md * 2 * added strings.md in the kotlin folder * did the changes that were asked :D * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * Update content/kotlin/concepts/strings/strings.md Co-authored-by: Brandon Dusch <[email protected]> * added changes Co-authored-by: SSwiniarski <[email protected]> Co-authored-by: Christine Yang <[email protected]> Co-authored-by: Brandon Dusch <[email protected]>
1 parent cd0ed49 commit 80094ba

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
Title: 'Strings'
3+
Description: 'Strings are immutable objects that are sequences of characters contained within a pair of double quotes.'
4+
Subjects:
5+
- 'Computer Science'
6+
Tags:
7+
- 'Strings'
8+
- 'Data Types'
9+
- 'Characters'
10+
CatalogContent:
11+
- 'learn-kotlin'
12+
- 'paths/computer-science'
13+
---
14+
15+
**Strings** are immutable objects that represent a sequence of characters contained within double quotes (`""`).
16+
17+
## Syntax
18+
19+
```pseudo
20+
val stringName: String = "string value"
21+
```
22+
23+
In Kotlin, string values are always defined as instances of the `String` class.
24+
25+
### String Templates
26+
27+
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 (`{}`).
28+
29+
## Example
30+
31+
The following example showcases the various ways strings are used in Kotlin:
32+
33+
```kotlin
34+
fun main(args: Array<String>) {
35+
// String literals
36+
val greeting: String = "Hello, World!"
37+
println(greeting)
38+
39+
// String templates
40+
val dynamicValue = 4
41+
val stringOne: String = "The value of dynamicValue is $dynamicValue"
42+
System.out.println(stringOne)
43+
44+
val a = dynamicValue
45+
val b = 5
46+
val stringTwo: String = "The sum of a and b is ${a + b}"
47+
System.out.println(stringTwo)
48+
}
49+
```
50+
51+
The output for the above code will be:
52+
53+
```shell
54+
Hello, World!
55+
The value of dynamicValue is 4
56+
The sum of a and b is 9
57+
```

0 commit comments

Comments
 (0)