Skip to content

Commit f5c6a5c

Browse files
committed
replace more 'char[]' with 'string'
1 parent 60ae95f commit f5c6a5c

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

rdmd.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ would be run (implies --chatty))
9595

9696
$(DT $(B --eval)=code) $(DD evaluate code including it in
9797
---
98-
void main(char[][] args) { ... }
98+
void main(string[] args) { ... }
9999
---
100100
(multiple --eval allowed, will be
101101
evaluated in turn))

spec/class.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ new Foo;
10141014
------
10151015
class Foo
10161016
{
1017-
this(char[] a) { ... }
1017+
this(string a) { ... }
10181018

10191019
new(uint size, int x, int y)
10201020
{

spec/ddoc.dd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ $(DD Explains the return value of the function.
335335
* Returns: The contents of the file.
336336
*/
337337

338-
void[] readFile(char[] filename) { ... }
338+
void[] readFile(string filename) { ... }
339339
------------------------------------
340340

341341
$(DT $(B See$(UNDERSCORE)Also:))
@@ -364,7 +364,7 @@ $(DD Lists exceptions thrown and under what circumstances they are thrown.)
364364
* Throws: WriteException on failure.
365365
*/
366366

367-
void writeFile(char[] filename) { ... }
367+
void writeFile(string filename) { ... }
368368
------------------------------------
369369

370370
$(DT $(B Version:))

spec/errors.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ $(UL
9393

9494
$(P The solution is to use exception handling to report errors. All
9595
errors are objects derived from abstract class $(D Error). $(D Error)
96-
has a pure virtual function called toString() which produces a $(D char[])
96+
has a pure virtual function called toString() which produces a $(D string)
9797
with a human readable description of the error.)
9898

9999
$(P If code detects an error like "out of memory," then an Error is thrown

spec/expression.dd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ $(GNAME InExpression):
496496
$(P An associative array can be tested to see if an element is in the array:)
497497

498498
-------------
499-
int foo[char[]];
499+
int foo[string];
500500
...
501501
if ("hello" in foo)
502502
...
@@ -2092,7 +2092,7 @@ import std.stdio, std.typecons;
20922092
void main()
20932093
{
20942094
alias Tup = Tuple!(int, string);
2095-
alias AA = long[char[]];
2095+
alias AA = long[string];
20962096

20972097
static if (is(Tup : Template!Args, alias Template, Args...))
20982098
{
@@ -2102,10 +2102,10 @@ void main()
21022102
writeln(typeid(Args[1])); // immutable(char)[]
21032103
}
21042104

2105-
static if (is(AA T : T[U], U : const char[]))
2105+
static if (is(AA T : T[U], U : string))
21062106
{
21072107
writeln(typeid(T)); // long
2108-
writeln(typeid(U)); // const char[]
2108+
writeln(typeid(U)); // string
21092109
}
21102110

21112111
static if (is(AA A : A[B], B : int))

spec/function.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2448,7 +2448,7 @@ $(H3 $(LNAME2 string-mixins, String Mixins and Compile Time Function Execution))
24482448
depend on compile time values of the function. For example:)
24492449

24502450
---
2451-
int foo(char[] s)
2451+
int foo(string s)
24522452
{
24532453
return mixin(s);
24542454
}

spec/statement.dd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ switch (number)
11481148
)
11491149

11501150
--------------
1151-
char[] name;
1151+
string name;
11521152
...
11531153
switch (name)
11541154
{
@@ -1889,11 +1889,11 @@ void main()
18891889
writeln(x + i, ++j);
18901890
"); // ok
18911891

1892-
const char[] s = "int y;";
1892+
string s = "int y;";
18931893
mixin(s); // ok
18941894
y = 4; // ok, mixin declared y
18951895

1896-
char[] t = "y = 3;";
1896+
string t = "y = 3;";
18971897
mixin(t); // error, t is not evaluatable at compile time
18981898

18991899
mixin("y =") 4; // error, string must be complete statement

wc.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main(string[] args)
3131
foreach(line; file.byLine(KeepTerminator.yes))
3232
{
3333
lCharCount += line.length;
34-
foreach(char[] word; splitter(line))
34+
foreach(string word; splitter(line))
3535
{
3636
lWordCount += 1;
3737
if(auto count = word in dictionary)

0 commit comments

Comments
 (0)