Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
12
Task/String-length/Pluto/string-length.pluto
Normal file
12
Task/String-length/Pluto/string-length.pluto
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
require "gchar"
|
||||
local fmt = require "fmt"
|
||||
|
||||
local moose = "møøse"
|
||||
local unicode = "𝔘𝔫𝔦𝔠𝔬𝔡𝔢"
|
||||
local jose = "J\u{332}o\u{332}s\u{332}e\u{301}\u{332}"
|
||||
|
||||
local f = "%5s %7s %5s"
|
||||
fmt.print("Strings : " .. f, moose, unicode, jose)
|
||||
fmt.print("\nBytes : " .. f, #moose, #unicode, #jose)
|
||||
fmt.print("\nCodepoints: " .. f, utf8.len(moose), utf8.len(unicode), utf8.len(jose))
|
||||
fmt.print("\nGraphemes : " .. f, gchar.of(moose):len(), gchar.of(unicode):len(), gchar.of(jose):len())
|
||||
Loading…
Add table
Add a link
Reference in a new issue