ITeye博客

土耳其文《d编程》range 翻译 二

hqs7636 · 2011-11-15 01:59 · DMD 2.0 · 编程语言 · Markdown

As you can see, that output does not match what we have seen in the Characters and Strings chapters. Since the elements of string and wstring are char and whar respectively, one might expect to see UTF code units in the previous output.

As a reminder, let's use the following function to see how different the use of strings as ranges is different from using them as arrays:

void printElements(T)(T str) { for (int i = 0; i != str.length; ++i) { write(' ', str*); }

writeln();

}

// ...

printElements("abcçdeé

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。