Jump to content

Special characters: Difference between revisions

m
no edit summary
(Added XPL0 example.)
mNo edit summary
Line 2,661:
* [[ ]] bash specific feature
* (( )) arithmetic expansion enclosures
 
=={{header|V (Vlang)}}==
Note: Further elaboration can be found in the documentation.
<syntaxhighlight lang="Vlang">
// escape codes
windows_newline := '\r\n' // escape special characters like in C
assert windows_newline.len == 2
 
// arbitrary bytes can be directly specified using `\x##`
// a hex digit aardvark_str := '\x61ardvark' assert aardvark_str == 'aardvark'
assert '\xc0'[0] == u8(0xc0)
 
// or using octal escape `\###` notation where `#` is an octal digit
aardvark_str2 := '\141ardvark'
assert aardvark_str2 == 'aardvark'
 
// Unicode can be specified directly as `\u####` where # is a hex digit
// and will be converted internally to its UTF-8 representation
star_str := '\u2605' // ★
assert star_str == '★'
assert star_str == '\xe2\x98\x85' // UTF-8 can be specified this way too.
</syntaxhighlight>
 
=={{header|Wren}}==
291

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.