On Wednesday, 7 July 2021 at 12:22:11 UTC, BoQsc wrote:
I think nested foreach loops are more readable.
```
import std;
void main()
{
alias alphabet = letters;
char[26] letters = ['a','b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j',
'k', 'l',
I think nested foreach loops are more readable.
```
import std;
void main()
{
alias alphabet = letters;
char[26] letters = ['a','b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r',
On Tuesday, 6 July 2021 at 15:48:35 UTC, rassoc wrote:
You can also do:
```d
import std;
void main()
{
// https://dlang.org/phobos/std_ascii.html#.lowercase
"Book.".filter!(c => lowercase.canFind(c))
.each!(c => writeln(c, " found"));
// Output:
// o found
//
You can also do:
```d
import std;
void main()
{
// https://dlang.org/phobos/std_ascii.html#.lowercase
"Book.".filter!(c => lowercase.canFind(c))
.each!(c => writeln(c, " found"));
// Output:
// o found
// o found
// k found
}
```
On Tuesday, 6 July 2021 at 11:35:14 UTC, BoQsc wrote:
I tried out .canFind method, and to test it I removed the
letter 'o' from the Alphabet.
Weirdly enough .canFind method still found 'o' letter among the
Alphabet.
https://run.dlang.io/is/2Fvenf
Looks like it has something to do with the
On Monday, 5 July 2021 at 19:48:13 UTC, jfondren wrote:
On Monday, 5 July 2021 at 19:34:14 UTC, BoQsc wrote:
But I really don't like how it looks less readable and makes
less sense on first look.
`if (([letter].findAmong(alphabet)).length)`
I'd like to use some method on the `letter` instead
On Monday, 5 July 2021 at 19:34:14 UTC, BoQsc wrote:
But I really don't like how it looks less readable and makes
less sense on first look.
`if (([letter].findAmong(alphabet)).length)`
I'd like to use some method on the `letter` instead of []
And `.length` does not make a lot of sense when
On Monday, 5 July 2021 at 19:25:23 UTC, jfondren wrote:
On Monday, 5 July 2021 at 19:19:19 UTC, BoQsc wrote:
If I use `[letter].findAmong(alphabet)` in my code, it
considers a dot (.) punctuation character as a letter.
You can see it here:
https://run.dlang.io/is/YWmaXU
It returns a
On Monday, 5 July 2021 at 19:19:19 UTC, BoQsc wrote:
If I use `[letter].findAmong(alphabet)` in my code, it
considers a dot (.) punctuation character as a letter.
You can see it here:
https://run.dlang.io/is/YWmaXU
It returns a zero-length array that, because it's not null, is
true. That's
On Monday, 5 July 2021 at 18:59:09 UTC, jfondren wrote:
On Monday, 5 July 2021 at 18:53:27 UTC, jfondren wrote:
If you replace the findAmong call with
`[letter].findAmong(alphabet)`, this works.
Consider:
```d
import std;
void main() {
import std.ascii : alphabet = letters;
On Monday, 5 July 2021 at 18:53:27 UTC, jfondren wrote:
If you replace the findAmong call with
`[letter].findAmong(alphabet)`, this works.
Consider:
```d
import std;
void main() {
import std.ascii : alphabet = letters;
string wordExample = "Book.";
foreach (letter;
On Monday, 5 July 2021 at 18:45:10 UTC, BoQsc wrote:
I get an error when I try to find that letter is among alphabet.
onlineapp.d(13): Error: template
`std.algorithm.searching.findAmong` cannot deduce function
from argument types `!()(immutable(char), immutable(string))`,
candidates
I get an error when I try to find that letter is among alphabet.
onlineapp.d(13): Error: template
`std.algorithm.searching.findAmong` cannot deduce function from
argument types `!()(immutable(char), immutable(string))`,
candidates are:
/dlang/dmd/linux/bin64/../../src/phobos/std/algorithm
Thank you, core.runtime.Runtime.initialize() fixed the issue. I
am now able to use to!string as well. I found your posts and Ali
Çehreli's posts on this subject. I think I have some
understanding now.
On Saturday, 9 December 2017 at 06:14:36 UTC, Venkat wrote:
Thanks for the quick response. std.string.fromStringz did the
trick. I am not sure what was the deal with to!string.
Be careful with fromStringz. It doesn't allocate a new string, so
the returned string can easily become corrupted if
Thanks for the quick response. std.string.fromStringz did the
trick. I am not sure what was the deal with to!string.
On Saturday, 9 December 2017 at 05:55:21 UTC, Venkat wrote:
I am trying out the DJni library
(https://github.com/Monnoroch/DJni). For some reason
std.conv.to!string doesn't want to convert a char* to a
string.The lines below are taken from the log. I see that the
last frame is at gc_qalloc. I
I am trying out the DJni library
(https://github.com/Monnoroch/DJni). For some reason
std.conv.to!string doesn't want to convert a char* to a
string.The lines below are taken from the log. I see that the
last frame is at gc_qalloc. I am not sure why it failed there.
Can anybody elaborate on
On Thursday, 13 July 2017 at 22:36:47 UTC, Basile B. wrote:
return cast(char[])`
...
Never cast a literal to char[]. modifying the resulting char[]
will lead to AV, at least under linux. `.dup` the literal if
you really needs char[].
Hmm, yes, my bad. Probably, it was necessary even
On Thursday, 13 July 2017 at 22:30:29 UTC, crimaniak wrote:
On Thursday, 13 July 2017 at 21:49:40 UTC, dark777 wrote:
Pessoal eu fiz o seguinte programa em C++.
https://pastebin.com/CvVv6Spn
porem tentei fazer o equivalente em D mas nao entendi muito
bem...
https://pastebin.com/2xw9geRR
On Thursday, 13 July 2017 at 22:30:29 UTC, crimaniak wrote:
On Thursday, 13 July 2017 at 21:49:40 UTC, dark777 wrote:
char[] stalman()
{
return cast(char[])`
((__-^^-,-^^-__))
*---***---*
*--|o o|--*
On Thursday, 13 July 2017 at 21:49:40 UTC, dark777 wrote:
Pessoal eu fiz o seguinte programa em C++.
https://pastebin.com/CvVv6Spn
porem tentei fazer o equivalente em D mas nao entendi muito
bem...
https://pastebin.com/2xw9geRR
alguem poderia me ajudar?
Se acepta utilizar intervalos en
Pessoal eu fiz o seguinte programa em C++.
https://pastebin.com/CvVv6Spn
porem tentei fazer o equivalente em D mas nao entendi muito bem...
https://pastebin.com/2xw9geRR
alguem poderia me ajudar?
On Thursday, 5 May 2016 at 07:49:46 UTC, aki wrote:
Hello,
When I need to call C function, often need to
have char* pointer from string.
"Interfacing to C++" page:
https://dlang.org/spec/cpp_interface.html
have following example.
extern (C) int strcmp(char* string1, char* string
On Thursday, 5 May 2016 at 07:49:46 UTC, aki wrote:
extern (C) int strcmp(char* string1, char* string2);
This signature of strcmp is incorrect. strcmp accepts const char*
arguments [1], which in D would be written as const(char)*. The
immutable(char)* values returned from toStringz are
On 5/5/16 3:36 PM, Steven Schveighoffer wrote:
Only thing I can think of is.. um... horrible:
char *toCharz(string s)
{
auto cstr = s.toStringz;
return cstr[0 .. s.length + 1].dup.ptr;
}
Ignore this. What Jonathan said :)
-Steve
On Thursday, 5 May 2016 at 11:35:09 UTC, Jonathan M Davis wrote:
If you want a different mutability, then use the more general
function std.utf.toUTFz. e.g. from the documentation:
auto p1 = toUTFz!(char*)("hello world");
auto p2 = toUTFz!(const(char)*)("hello world");
auto p3 =
On 5/5/16 11:53 AM, pineapple wrote:
On Thursday, 5 May 2016 at 07:49:46 UTC, aki wrote:
Hello,
When I need to call C function, often need to
have char* pointer from string.
This might help:
import std.traits : isSomeString;
import std.string : toStringz;
extern (C) int strcmp(char
On Thu, 05 May 2016 07:49:46 +
aki via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:
> Hello,
>
> When I need to call C function, often need to
> have char* pointer from string.
>
> "Interfacing to C++" page:
> https://dlang.org/spe
On Thursday, 5 May 2016 at 07:49:46 UTC, aki wrote:
Hello,
When I need to call C function, often need to
have char* pointer from string.
This might help:
import std.traits : isSomeString;
import std.string : toStringz;
extern (C) int strcmp(char* string1, char* string2);
int strcmpD0(S
Hello,
When I need to call C function, often need to
have char* pointer from string.
"Interfacing to C++" page:
https://dlang.org/spec/cpp_interface.html
have following example.
extern (C) int strcmp(char* string1, char* string2);
import std.string;
int myDfunction(char[] s)
{
On Wednesday, October 21, 2015 14:11:20 anonymous via Digitalmars-d-learn wrote:
> On Wednesday, 21 October 2015 at 14:06:54 UTC, Shriramana Sharma
> wrote:
> > import std.stdio, std.range;
> > void mywrite(char [5] chars, real[5] vals)
> > {
> > static string [5] fmts = ["%9.4f, ", "%9.4f; ",
On Wednesday, 21 October 2015 at 14:06:54 UTC, Shriramana Sharma
wrote:
import std.stdio, std.range;
void mywrite(char [5] chars, real[5] vals)
{
static string [5] fmts = ["%9.4f, ", "%9.4f; ", "%3d, ",
"%3d, ",
"%3d\n"];
foreach (e; zip(chars, fmts, vals)) write(e[0], " = ",
[2]));
}
Compiling gives:
zip_string.d(5): Error: template std.range.zip cannot deduce function from
argument types !()(char[5], string[5], real[5]), candidates are:
/usr/include/dmd/phobos/std/range/package.d(3678):
std.range.zip(Ranges...)(Ranges ranges) if (Ranges.length && allSatisfy!
builder fails, with the error message:
runnable/test23.d(1219): Error: cannot implicitly convert expression
(format(s = %s, s)) of type char[] to string
The line which fails is `p = std.string.format(s = %s, s);`
I don't understand why I can't convert a char[] to string.
I think it has to do
expression (format(s = %s, s)) of type char[] to string
The line which fails is `p = std.string.format(s = %s, s);`
I don't understand why I can't convert a char[] to string.
I think it has to do with the fact that string is an alias to
immutable(char)[] and you can't implicitely cast
:
runnable/test23.d(1219): Error: cannot implicitly convert
expression (format(s = %s, s)) of type char[] to string
The line which fails is `p = std.string.format(s = %s, s);`
I don't understand why I can't convert a char[] to string.
I think it has to do with the fact that string is an alias
implicitly convert expression
(format(s = %s, s)) of type char[] to string
The line which fails is `p = std.string.format(s = %s, s);`
I don't understand why I can't convert a char[] to string.
Get rid of the 'in' in format's signature.
Oh, I see, this is by design (which I don't like
= %s, s)) of type char[] to string
The line which fails is `p = std.string.format(s = %s, s);`
I don't understand why I can't convert a char[] to string.
Get rid of the 'in' in format's signature.
I made a PR to phobos where I modified `std.format.format`.
https://github.com/D-Programming-Language/phobos/pull/3528
However the auto builder fails, with the error message:
runnable/test23.d(1219): Error: cannot implicitly convert
expression (format(s = %s, s)) of type char[] to string
On 07/10/2014 09:05 AM, Alexandre wrote:
I have a string X and I need to insert a char in that string...
auto X = 100;
And I need to inser a ',' in position 3 of this string..., I try to use
the array.insertInPlace, but, not work...
I try this:
auto X = 100;
auto N
On Thursday, 10 July 2014 at 19:33:15 UTC, simendsjo wrote:
On 07/10/2014 06:05 PM, Alexandre wrote:
I have a string X and I need to insert a char in that string...
auto X = 100;
And I need to inser a ',' in position 3 of this string..., I
try to use
the array.insertInPlace
I have a string X and I need to insert a char in that string...
auto X = 100;
And I need to inser a ',' in position 3 of this string..., I try
to use the array.insertInPlace, but, not work...
I try this:
auto X = 100;
auto N = X.insertInPlace(1,'0');
On Thursday, 10 July 2014 at 16:05:51 UTC, Alexandre wrote:
I have a string X and I need to insert a char in that string...
auto X = 100;
And I need to inser a ',' in position 3 of this string..., I
try to use the array.insertInPlace, but, not work...
I try this:
auto X
Sorry..
I mean:
auto X = 100;
auto N = X.insertInPlace(3,',');
On Thursday, 10 July 2014 at 16:05:51 UTC, Alexandre wrote:
I have a string X and I need to insert a char in that string...
auto X = 100;
And I need to inser a ',' in position 3 of this string..., I
try
I used that solution:
string InsertComma(string val)
{
return val[0 .. $-2] ~ , ~ val[$-2 .. $];
}
On Thursday, 10 July 2014 at 16:23:44 UTC, John Colvin wrote:
On Thursday, 10 July 2014 at 16:05:51 UTC, Alexandre wrote:
I have a string X and I need to insert a char in that string
On Thursday, 10 July 2014 at 16:20:29 UTC, Alexandre wrote:
Sorry..
I mean:
auto X = 100;
auto N = X.insertInPlace(3,',');
On Thursday, 10 July 2014 at 16:05:51 UTC, Alexandre wrote:
I have a string X and I need to insert a char in that string...
auto X = 100;
And I
at 16:05:51 UTC, Alexandre wrote:
I have a string X and I need to insert a char in that
string...
auto X = 100;
And I need to inser a ',' in position 3 of this string..., I
try to use the array.insertInPlace, but, not work...
I try this:
auto X = 100;
auto N
On 07/10/2014 06:05 PM, Alexandre wrote:
I have a string X and I need to insert a char in that string...
auto X = 100;
And I need to inser a ',' in position 3 of this string..., I try to use
the array.insertInPlace, but, not work...
I try this:
auto X = 100
at 19:33:15 UTC, simendsjo wrote:
On 07/10/2014 06:05 PM, Alexandre wrote:
I have a string X and I need to insert a char in that string...
auto X = 100;
And I need to inser a ',' in position 3 of this string..., I
try to use
the array.insertInPlace, but, not work...
I try
, here in Brazil...
On Thursday, 10 July 2014 at 19:33:15 UTC, simendsjo wrote:
On 07/10/2014 06:05 PM, Alexandre wrote:
I have a string X and I need to insert a char in that string...
auto X = 100;
And I need to inser a ',' in position 3 of this string..., I try to use
On Sunday, 18 May 2014 at 19:09:52 UTC, Chris Cain wrote:
On Sunday, 18 May 2014 at 18:55:59 UTC, Tim wrote:
Hi everyone,
is there any chance to modify a char in a string like:
As you've seen, you cannot modify immutables (string is an
immutable(char)[]). If you actually do want the string
On 05/19/2014 10:07 AM, Tim wrote:
I already tried:
void main()
{
char[] sMyText = Replace the last char_;
sMyText[$ - 1] = '.';
}
but I always getting Error: cannot implicitly convert expression
(Replace the last char_) of type string to char
Hi everyone,
is there any chance to modify a char in a string like:
void main()
{
string sMyText = Replace the last char_;
sMyText[$ - 1] = '.';
}
But when I execute the code above I'm always getting cannot
modify immutable expression at sMyText[__dollar -1LU]. I though
D supported
Tim:
is there any chance to modify a char in a string like:
void main()
{
string sMyText = Replace the last char_;
sMyText[$ - 1] = '.';
}
But when I execute the code above I'm always getting cannot
modify immutable expression at sMyText[__dollar -1LU]. I
though D supported
On Sunday, 18 May 2014 at 18:55:59 UTC, Tim wrote:
Hi everyone,
is there any chance to modify a char in a string like:
As you've seen, you cannot modify immutables (string is an
immutable(char)[]). If you actually do want the string to be
modifiable, you should define it as char[] instead
to change it in the function.
Can I overload a function to work for either a char[] or a string?
Many of the library functions that I need to call require string
arguments such as the replace below.
I believe I can create a wrapper function for it like this to
still get at the functionality
On Sunday, 30 March 2014 at 15:58:52 UTC, Gary Miller wrote:
Are there any alternate libraries for D that have a mutable
string datatype or is there a way to override the immutable
characteristic of the string datatype by reallocating it or
something?
string.dup property does a copy of
Gary Miller:
char[] ReplaceAllSubstrings(inout char[] Original,
in char[] SearchString,
in char[] Substring)
{
string SOriginal = Original.dup;
string SSearchString = SearchString.dup
I am presently working my way through TDPL for the second time,
and there's an example in chapter 1 to the effect of:
[code]
string currentParagraph;
foreach(line; stdin.byLine()) {
if (line.length 2) {
currentParagraph = to!string(line[2 .. $]);
}
}
[/code]
The explicit conversion
general?
I tried taking a peek at the implementation of to!string, but it wasn't
easy enough to follow and boil down into components.
I believe char[] - string conversion with to! will use this
implementation: https://github.com/D-Programming-Language/phobos/blob/
master/std/conv.d#L823
So
Mark Isaacson:
why use `to!string` instead of just doing `line[2 .. $].idup`?
I sometimes prefer the text function:
= line[2 .. $].text;
Bye,
bearophile
On Tuesday, 25 March 2014 at 21:35:47 UTC, Mark Isaacson wrote:
Is there a performance benefit? Is it simply because it's more
general?
Mostly because it's more generic. For example:
If instead you want to do string = char[], then your code
will have to be changed to use dup.
if instead you
Much appreciated everyone! I had a vague intuition that these
were the reasons, but it was helpful to spell them out. I'm
especially partial to the self-documentation reasoning.
On Tue, Mar 25, 2014 at 10:02:33PM +, monarch_dodra wrote:
On Tuesday, 25 March 2014 at 21:35:47 UTC, Mark Isaacson wrote:
Is there a performance benefit? Is it simply because it's more general?
[...]
There is *1* thing you should take into account though: to! is a
no-op for string=string
?
[...]
There is *1* thing you should take into account though: to! is a
no-op for string=string or char[]=char[], or anything else that can
be implicitly converted as such. In contrast, dup/idup will create
an actual copy.
Not that this is good or bad. Just something you should keep in mind.
I think it's a good
then do
string r = to!string(result);
or
char[] r = result[0 .. strlen(result)];
and use that/
to!(string) works great thanks!
then do
string r = to!string(result);
or
char[] r = result[0 .. strlen(result)];
and use that/
Another question: how do i convert const(char)** to string[]?
Gary Willoughby:
Another question: how do i convert const(char)** to string[]?
If you know that you have N strings, then a solution is
(untested):
pp[0 .. N].map!text.array
If it doesn't work, try:
pp[0 .. N].map!(to!string).array
Bye,
bearophile
You are going to need the length of your c char*[] then a
for-loop should do it :D
On Thursday, 2 January 2014 at 15:31:25 UTC, bearophile wrote:
If you know that you have N strings, then a solution is
(untested):
Or if it is zero terminated, maybe
pp.until!a is null.map!text.array
Though personally I'd just use the plain old for loop.
On Thursday, 2 January 2014 at 15:53:40 UTC, Adam D. Ruppe wrote:
On Thursday, 2 January 2014 at 15:31:25 UTC, bearophile wrote:
If you know that you have N strings, then a solution is
(untested):
Or if it is zero terminated, maybe
pp.until!a is null.map!text.array
Though personally I'd
On Thursday, 2 January 2014 at 15:31:25 UTC, bearophile wrote:
Gary Willoughby:
Another question: how do i convert const(char)** to string[]?
If you know that you have N strings, then a solution is
(untested):
pp[0 .. N].map!text.array
If it doesn't work, try:
pp[0 .. N].map!(to!string
i'll answer in code
http://dpaste.dzfl.pl/2bb1a1a8
Gary Willoughby:
I've noticed that const(char)** can be accessed via indexes:
writefln(%s, pp[0].to!(string)); //etc.
cool!
This is a feature that works with all pointers to a sequence of
items, like in C. But array bounds are not verified, so it's more
bug-prone. So if you know the
I'm calling an external C function which returns a string
delivered via a char*. When i print this string out, like this:
char* result = func();
writefln(String: %s, *result);
I only get one character printed. I guess this is expected
because i'm only returned a pointer to the first char.
On Wednesday, 1 January 2014 at 23:03:06 UTC, Gary Willoughby
wrote:
I'm calling an external C function which returns a string
delivered via a char*. When i print this string out, like this:
char* result = func();'
you can then do
string r = to!string(result);
or
char[] r = result[0
On Wednesday, 1 January 2014 at 23:03:06 UTC, Gary Willoughby
wrote:
I'm calling an external C function which returns a string
delivered via a char*. When i print this string out, like this:
char* result = func();
writefln(String: %s, *result);
I only get one character printed.
You're not
On Thursday, 14 November 2013 at 19:41:13 UTC, Agustin wrote:
I'm trying to use http://dlang.org/phobos/std_net_curl.html and
when i compile the same example i get:
cannot implicitly convert expression
(get(cast(const(char)[])address, AutoProtocol())) of type
char[] to string
string
I'm trying to use http://dlang.org/phobos/std_net_curl.html and
when i compile the same example i get:
cannot implicitly convert expression
(get(cast(const(char)[])address, AutoProtocol())) of type char[]
to string
string address = http://dlang.org;;
string _data = get(address);
On Thursday, 14 November 2013 at 19:41:13 UTC, Agustin wrote:
I'm trying to use http://dlang.org/phobos/std_net_curl.html and
when i compile the same example i get:
cannot implicitly convert expression
(get(cast(const(char)[])address, AutoProtocol())) of type
char[] to string
string
())) of type char[] to string
string address = http://dlang.org;;
string _data = get(address);
`get` returns mutable data, one should respect it:
char[] data = get(address); // or just use `auto data = `
However, that data can automatically be converted to string if get()
were pure. (I can understand
)[])address, AutoProtocol())) of type
char[] to string
string address = http://dlang.org;;
string _data = get(address);
You have two options:
string address = http://dlang.org;;
string _data = get(address).idup(); // create immutable copy
or
string address = http://dlang.org
I'm trying to create a split function that can handle both char
and string delims. I initially created two separate functions but
this doesn't work for default parameters since the compiler
doesn't know which one to choose(but in this case both would work
fine and it would be nice to inform
On Friday, 19 July 2013 at 17:18:00 UTC, JS wrote:
I'm trying to create a split function that can handle both char
and string delims. I initially created two separate functions
but this doesn't work for default parameters since the compiler
doesn't know which one to choose(but in this case
On Friday, 19 July 2013 at 17:18:00 UTC, JS wrote:
I'm trying to create a split function that can handle both char
and string delims. I initially created two separate functions
but this doesn't work for default parameters since the compiler
doesn't know which one to choose(but in this case
On 07/19/2013 10:40 AM, anonymous wrote:
On Friday, 19 July 2013 at 17:18:00 UTC, JS wrote:
for(int j = 0; j s.length - d.length; j++)
This j would shadow the one above. Just choose another name.
Even better:
foreach (k; 0 .. s.length - d.length)
or:
foreach (k;
On Fri, Jul 19, 2013 at 07:17:57PM +0200, JS wrote:
[...]
string[] split(T)(string s, T d) if (is(T == char) || is(T ==
string))
{
int i = 0, oldj = 0; bool ok = true;
string[] r;
foreach(j, c; s)
{
static if (is(T == char
On Friday, 19 July 2013 at 17:25:34 UTC, JS wrote:
BTW, I'd like to have a default value for d. That or efficiently
allow for variadic d, which then the default delim could easily
be tested for.
To answer your previous question about shadowing, you are
probably experiencing an old bug where
On Friday, 19 July 2013 at 17:18:00 UTC, JS wrote:
both functions work separately but when i uncomment the string
version I get an error about the string version shadowing.
import std.stdio, std.cstream;
string[] split(T)(string s, T d) if (is(T == char) || is(T ==
string))
{
int i
Is this the fastest way to append a char to string?
char c = 'a';
string s;
s ~= c;
?
I have a program that does this many many times... and it's slow.
So I was wondering it it could be it.
Thanks for tips!
On Tuesday, 11 December 2012 at 15:52:31 UTC, Chopin wrote:
Is this the fastest way to append a char to string?
char c = 'a';
string s;
s ~= c;
?
I have a program that does this many many times... and it's
slow. So I was wondering it it could be it.
Thanks for tips!
This may or may
Chopin:
Is this the fastest way to append a char to string?
char c = 'a';
string s;
s ~= c;
?
I have a program that does this many many times... and it's
slow. So I was wondering it it could be it.
Try the appender from std.array. It's supposed to be faster, but
sometimes it's not faster
, October 20, 2011 8:19 PM
Subject: Re: char and string with umlauts
On Thursday, October 20, 2011 09:48 Jim Danley wrote:
I have been a programmer for many years and started using D about one
year
back. Suddenly, I find myself in unfamiliar territory. I need to used
Finish umlauts in chars
I have been a programmer for many years and started using D about one year
back. Suddenly, I find myself in unfamiliar territory. I need to used
Finish umlauts in chars and strings, but they are not part of my usual
American ASCII character set.
Can anyone point me in the right direction?
Make sure your source file is saved in UTF-8 format.
On Thursday, October 20, 2011 09:48 Jim Danley wrote:
I have been a programmer for many years and started using D about one year
back. Suddenly, I find myself in unfamiliar territory. I need to used
Finish umlauts in chars and strings, but they are not part of my usual
American ASCII character
On Thu, 20 Oct 2011 19:48:54 +0300, Jim Danley wrote:
I have been a programmer for many years and started using D about one
year back. Suddenly, I find myself in unfamiliar territory. I need to
used Finish umlauts in chars and strings, but they are not part of my
usual American ASCII
On Thu, 20 Oct 2011 19:48:54 +0300, Jim Danley wrote:
I have been a programmer for many years and started using D about one
year back. Suddenly, I find myself in unfamiliar territory. I need to
used Finish umlauts in chars and strings, but they are not part of my
usual American ASCII
Jonathan M Davis:
Even better though, would be to use std.conv.to - e.g. to!string(input). This
will
convert input to a string, but it has the advantage that if input is already
a
string, then it'll just return the string rather than making another copy
like
idup would.
I didn't
1 - 100 of 115 matches
Mail list logo