删除空白字符什么是从一个char []中D.删除空白例如,使用DMD 2.057我有recomended方式, import std.stdio;
import std.string;
import std.algorithm;
char[] line;
int main(){
line = r"this is a line with spaces ";
line
如何在D中将整数转换为字符串? 喜欢的东西 int i = 15
string message = "Value of 'i' is " ~ toString(i); // cast(string) i - also does not work
谷歌给我带来了关于如何与探戈做的答案,但我要的火卫一的版本。
我想使用切片运算符从std.range中获取take函数的返回值的一部分。我的代码: auto tempChunk = ['a', 'b', 'c', 'd'];
auto a = tempChunk.take(3);
writeln(a[0..2]);
由于采取R的情况下,仅仅是对的char []的别名,我期望这个编译。但是,编译器告诉我,Take!(char[]) cannot be
我尝试编译下面的代码: import std.algorithm;
void main()
{
string[] x = ["ab", "cd", "ef"]; // 'string' is same as 'immutable(char)[]'
string space = " ";
char z = joiner(x, space).front(); // e