Skip to content

Commit 86eb7e1

Browse files
committed
add Julia language
1 parent 598d673 commit 86eb7e1

File tree

5 files changed

+56
-0
lines changed

5 files changed

+56
-0
lines changed

count-bytes/julia.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Count encoded bytes in Julia
2+
3+
The core `endof` function returns the number of bytes in UTF-8 when called on a
4+
string.
5+
6+
```julia
7+
count = endof(str)
8+
```

count-characters/julia.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Count characters of a string in Julia
2+
3+
## Code points
4+
5+
The core `length` function returns the number of code points when called on a string.
6+
7+
```julia
8+
count = length(str)
9+
```
10+
11+
## Grapheme clusters
12+
13+
The [UnicodeExtras](https://github.com/nolta/UnicodeExtras.jl) module provides
14+
the `length` function, which returns the number of grapheme clusters when called
15+
on a string.
16+
17+
```julia
18+
using UnicodeExtras
19+
20+
count = length(str)
21+
```

encode-decode/julia.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Encode and decode in Julia
2+
3+
The [UnicodeExtras](https://github.com/nolta/UnicodeExtras.jl) module provides
4+
the `encode` function, which accepts a string and returns an array of bytes in
5+
the specified encoding, and the `decode` function, which accepts an array of
6+
bytes in the specified encoding and returns a string.
7+
8+
```julia
9+
using UnicodeExtras
10+
11+
utf16 = encode(str, 'UTF-16')
12+
str = decode(utf16, 'UTF-16')
13+
```

letter-casing/julia.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Letter Casing in Julia
2+
3+
The [UnicodeExtras](https://github.com/nolta/UnicodeExtras.jl) module provides
4+
the `lowercase`, `uppercase`, `titlecase`, and `foldcase` functions.
5+
6+
```julia
7+
lowercase = lowercase(str)
8+
uppercase = uppercase(str)
9+
titlecase = titlecase(str)
10+
casefold = foldcase(str)
11+
```

source-code/julia.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# UTF-8 source code in Julia
2+
3+
Source code is expected to be UTF-8 by default.

0 commit comments

Comments
 (0)