June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
1
Task/String-length/Aime/string-length-2.aime
Normal file
1
Task/String-length/Aime/string-length-2.aime
Normal file
|
|
@ -0,0 +1 @@
|
|||
~"Hello, World!"
|
||||
8
Task/String-length/BaCon/string-length.bacon
Normal file
8
Task/String-length/BaCon/string-length.bacon
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
PRINT "Bytelen of 'hello': ", LEN("hello")
|
||||
PRINT "Charlen of 'hello': ", ULEN("hello")
|
||||
|
||||
PRINT "Bytelen of 'møøse': ", LEN("møøse")
|
||||
PRINT "Charlen of 'møøse': ", ULEN("møøse")
|
||||
|
||||
PRINT "Bytelen of '𝔘𝔫𝔦𝔠𝔬𝔡𝔢': ", LEN("𝔘𝔫𝔦𝔠𝔬𝔡𝔢")
|
||||
PRINT "Charlen of '𝔘𝔫𝔦𝔠𝔬𝔡𝔢': ", ULEN("𝔘𝔫𝔦𝔠𝔬𝔡𝔢")
|
||||
2
Task/String-length/HolyC/string-length.holyc
Normal file
2
Task/String-length/HolyC/string-length.holyc
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
U8 *string = "Hello, world!";
|
||||
Print("%d\n", StrLen(string));
|
||||
21
Task/String-length/JavaScript/string-length-3.js
Normal file
21
Task/String-length/JavaScript/string-length-3.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
let
|
||||
str='AöЖ€𝄞'
|
||||
,countofcodeunits=str.length // 6
|
||||
,cparr=[...str],
|
||||
,countofcodepoints=cparr.length; // 5
|
||||
{ let
|
||||
count=0
|
||||
for(let codepoint of str)
|
||||
count++
|
||||
countofcodepoints=count // 5
|
||||
}
|
||||
{ let
|
||||
count=0,
|
||||
it=str[Symbol.iterator]()
|
||||
while(!it.next().done)
|
||||
count++
|
||||
countofcodepoints=count // 5
|
||||
}
|
||||
{ cparr=Array.from(str)
|
||||
countofcodepoints=cparr.length // 5
|
||||
}
|
||||
4
Task/String-length/Rust/string-length-1.rust
Normal file
4
Task/String-length/Rust/string-length-1.rust
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
fn main() {
|
||||
let s = "文字化け"; // UTF-8
|
||||
println!("Byte Length: {}", s.len());
|
||||
}
|
||||
4
Task/String-length/Rust/string-length-2.rust
Normal file
4
Task/String-length/Rust/string-length-2.rust
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
fn main() {
|
||||
let s = "文字化け"; // UTF-8
|
||||
println!("Character length: {}", s.chars().count());
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
fn main(){
|
||||
let len = String::from("Hello world").len();
|
||||
println!("{}", len);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue