mirror of
https://github.com/dlang/phobos.git
synced 2025-05-08 03:56:54 +03:00
11 lines
296 B
Text
11 lines
296 B
Text
Added `std.utf.decodeBack` which decodes the last UTF code point of given character range.
|
|
-------
|
|
import std.utf : decodeBack;
|
|
|
|
string text = "サイト";
|
|
|
|
assert(decodeBack(text) == 'ト');
|
|
assert(decodeBack(text) == 'イ');
|
|
assert(decodeBack(text) == 'サ');
|
|
assert(text.empty);
|
|
-------
|