Updated smnp.text (markdown)
14
smnp.text.md
14
smnp.text.md
@@ -12,8 +12,22 @@ Checks if length of string is greater than 0.
|
||||
Tries to convert `string` to `int`. If the text actually represents an `int`, it returns it as of `int` type. It returns itself (as a `string`) otherwise.
|
||||
|
||||
## `string.substring(startIndex: int, endIndex: int)`
|
||||
Returns a substring.
|
||||
|
||||
### Example
|
||||
```
|
||||
println("Hello world".substring(1, 5)); # ello
|
||||
```
|
||||
|
||||
## `string.split(delimiter: string)`
|
||||
Splits the string with given delimiter to list of strings and returns it.
|
||||
|
||||
### Example
|
||||
```
|
||||
str = "this:is:some:text";
|
||||
|
||||
println(str.split(":")); # [this, is, some, text]
|
||||
```
|
||||
|
||||
## `string.toFloat()`
|
||||
Tries to convert `string` to `float`. If the text actually represents a `float`, it returns it as of `float` type. It returns itself (as a `string`) otherwise.
|
||||
|
||||
Reference in New Issue
Block a user