Skip to content

Commit

Permalink
Update the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mertyildiran committed Apr 26, 2020
1 parent 40f1b1a commit cb0f923
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import string

## String operations

### string.replace(str target, str needle, str replacement)
### str string.replace(str target, str needle, str replacement)

Replace all occurrences of the `needle` string with the `replacement` string.

Expand All @@ -21,7 +21,7 @@ kaos> string.replace("hello world", "world", "friend")
hello friend
```

### string.upper(str s)
### str string.upper(str s)

Make the all characters in string `s` uppercase.

Expand All @@ -30,7 +30,7 @@ kaos> string.upper("hello world")
HELLO WORLD
```

### string.lower(str s)
### str string.lower(str s)

Make the all characters in string `s` lowercase.

Expand All @@ -40,7 +40,7 @@ kaos> string.lower("HeLlO WoRLd")
hello world
```

### string.capitalize(str s)
### str string.capitalize(str s)

Capitalize the string `s`.

Expand All @@ -49,7 +49,7 @@ kaos> string.capitalize("hello world")
Hello world
```

### string.concat(str s1, str s2)
### str string.concat(str s1, str s2)

Concatenate string `s1` and string `s2`.

Expand All @@ -58,7 +58,7 @@ kaos> string.concat("hello", " world")
hello world
```

### string.split(str s, str delimiter)
### list string.split(str s, str delimiter)

Split the string `s` into a list according to the string `delimiter`.

Expand All @@ -67,7 +67,7 @@ kaos> string.split("A quick brown fox jumps over the lazy dog", " ")
['A', 'quick', 'brown', 'fox', 'jumps', 'over', 'the', 'lazy', 'dog']
```

### string.join(list words, str separator)
### str string.join(list words, str separator)

Concatenate a list of strings `words` into a string by separating them with string `separator`.

Expand All @@ -81,7 +81,7 @@ foobarbaz

## Information functions

### string.length(str s)
### num string.length(str s)

Returns the length of the string `s`.

Expand All @@ -90,7 +90,7 @@ kaos> string.length("hello world")
11
```

### string.is_empty(str s)
### bool string.is_empty(str s)

Returns whether the string `s` empty or not.

Expand All @@ -101,7 +101,7 @@ kaos> string.is_empty("")
true
```

### string.is_numeric(str s)
### bool string.is_numeric(str s)

Returns `true` if all characters in the string `s` are numeric characters, and there is at least one character, `false` otherwise.

Expand All @@ -118,7 +118,7 @@ kaos> string.is_numeric("")
false
```

### string.is_alpha(str s)
### bool string.is_alpha(str s)

Returns `true` if string `s` only contains alphabetic characters or whitespace and not empty, `false` otherwise.

Expand All @@ -133,7 +133,7 @@ kaos> string.is_alpha("")
false
```

### string.is_alnum(str s)
### bool string.is_alnum(str s)

Returns `true` if string `s` only contains alphanumeric characters or whitespace and not empty, `false` otherwise.

Expand All @@ -146,7 +146,7 @@ kaos> string.is_alnum("")
false
```

### string.is_space(str s)
### bool string.is_space(str s)

Returns `true` if string `s` only contains whitespaces and not empty, `false` otherwise.

Expand All @@ -165,7 +165,7 @@ kaos> string.is_space("")
false
```

### string.is_lower(str s)
### bool string.is_lower(str s)

Returns `true` if string `s` only contains lowercase alphabetic characters, numeric characters or whitespace, `false` otherwise.

Expand All @@ -184,7 +184,7 @@ kaos> string.is_lower("")
false
```

### string.is_upper(str s)
### bool string.is_upper(str s)

Returns `true` if string `s` only contains uppercase alphabetic characters, numeric characters or whitespace, `false` otherwise.

Expand All @@ -205,7 +205,7 @@ false

## String constants

### string.whitespace()
### str string.whitespace()

Returns the string that contains whitespace characters ` \t\n\r\v\f`.

Expand All @@ -214,7 +214,7 @@ kaos> string.whitespace()
\t\n\r\v\f
```

### string.ascii_lowercase()
### str string.ascii_lowercase()

Returns the string that contains [ASCII](https://en.wikipedia.org/wiki/ASCII) lowercase letters `abcdefghijklmnopqrstuvwxyz`.

Expand All @@ -223,7 +223,7 @@ kaos> string.ascii_lowercase()
abcdefghijklmnopqrstuvwxyz
```

### string.ascii_uppercase()
### str string.ascii_uppercase()

Returns the string that contains [ASCII](https://en.wikipedia.org/wiki/ASCII) uppercase letters `ABCDEFGHIJKLMNOPQRSTUVWXYZ`.

Expand All @@ -232,7 +232,7 @@ kaos> string.ascii_uppercase()
ABCDEFGHIJKLMNOPQRSTUVWXYZ
```

### string.ascii_letters()
### str string.ascii_letters()

Returns the string that contains [ASCII](https://en.wikipedia.org/wiki/ASCII) letters `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`.

Expand All @@ -241,7 +241,7 @@ kaos> string.ascii_letters()
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
```

### string.digits()
### str string.digits()

Returns the string that contains decimal digits `0123456789`.

Expand All @@ -250,7 +250,7 @@ kaos> string.digits()
0123456789
```

### string.hexdigits()
### str string.hexdigits()

Returns the string that contains hexadecimal digits `0123456789abcdefABCDEF`.

Expand All @@ -259,7 +259,7 @@ kaos> string.hexdigits()
0123456789abcdefABCDEF
```

### string.octdigits()
### str string.octdigits()

Returns the string that contains octal digits `0123456789`.

Expand All @@ -268,7 +268,7 @@ kaos> string.octdigits()
01234567
```

### string.punctuation()
### str string.punctuation()

Returns the characters considered punctuation according to [ASCII](https://en.wikipedia.org/wiki/ASCII) `!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~`

Expand Down
2 changes: 1 addition & 1 deletion occultist.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "string",
"version": "1.0.0",
"version": "1.0.1",
"description": "String library of the Chaos language.",
"tags": ["official", "string", "str"],
"type": "extension",
Expand Down

0 comments on commit cb0f923

Please sign in to comment.