On Friday, 4 March 2022 at 02:36:35 UTC, Ali Çehreli wrote:
I assumed it would generate separate integers 123 and 456. I
started to implement a range with findSkip, findSplit, and
friends but failed. :/
I worked on it a little. I guess it's better that way. But I
didn't think about negati
On Friday, 4 March 2022 at 02:36:35 UTC, Ali Çehreli wrote:
On 3/3/22 13:03, H. S. Teoh wrote:
>string s = "blahblah123blehbleh456bluhbluh";
>assert(result == 123456);
I assumed it would generate separate integers 123 and 456. I
started to implement a range with findSkip, findSplit, a
On 3/3/22 13:03, H. S. Teoh wrote:
>string s = "blahblah123blehbleh456bluhbluh";
>assert(result == 123456);
I assumed it would generate separate integers 123 and 456. I started to
implement a range with findSkip, findSplit, and friends but failed. :/
Ali
On Friday, 4 March 2022 at 01:30:00 UTC, Leonardo wrote:
Thanks but not worked here.
```
[leonardo@leonardo-pc dimportc]$ dmd --version
DMD64 D Compiler v2.098.1
Copyright (C) 1999-2021 by The D Language Foundation, All
Rights Reserved written by Walter Bright
[leonardo@leonardo-pc dimportc]$
On Thursday, 3 March 2022 at 20:23:14 UTC, forkit wrote:
On Thursday, 3 March 2022 at 19:28:36 UTC, matheus wrote:
I'm a simple man who uses D with the old C mentality:
[...]
```d
string s, str = "4A0B1de!2C9~6";
foreach(i;str){
if(i < '0' || i > '9'){ continue; }
s ~= i
Thanks but not worked here.
```
[leonardo@leonardo-pc dimportc]$ dmd --version
DMD64 D Compiler v2.098.1
Copyright (C) 1999-2021 by The D Language Foundation, All Rights
Reserved written by Walter Bright
[leonardo@leonardo-pc dimportc]$ ls
foo.c program.d
[leonardo@leonardo-pc dimportc]$ cat
On Thursday, 3 March 2022 at 19:05:22 UTC, Leonardo wrote:
I saw the new feature called ImportC, it's cool to be able to
use C code/libraries, but I'm not much experience in C and
didn't understand this incomplete documentation:
https://dlang.org/spec/importc.html
How to use ImportC?
You jus
On Thu, Mar 03, 2022 at 10:54:39PM +, matheus via Digitalmars-d-learn wrote:
> On Thursday, 3 March 2022 at 21:03:40 UTC, H. S. Teoh wrote:
[...]
> > --
> > void main() {
> > string s = "blahblah123blehbleh456bluhbluh";
> > auto result = s.filter!(ch => ch.isDigit).to!int;
> > a
On Thursday, 3 March 2022 at 21:03:40 UTC, H. S. Teoh wrote:
...
--
void main() {
string s = "blahblah123blehbleh456bluhbluh";
auto result = s.filter!(ch => ch.isDigit).to!int;
assert(result == 123456);
}
--
Problem solved. Why write 6 lines when 3 will do?
Ju
On Thu, Mar 03, 2022 at 08:23:14PM +, forkit via Digitalmars-d-learn wrote:
> On Thursday, 3 March 2022 at 19:28:36 UTC, matheus wrote:
> >
> > I'm a simple man who uses D with the old C mentality:
> >
> > import std.stdio;
> >
> > void main(){
> > string s, str = "4A0B1de!2C9~6";
> >
On Thursday, 3 March 2022 at 19:05:22 UTC, Leonardo wrote:
I saw the new feature called ImportC, it's cool to be able to
use C code/libraries, but I'm not much experience in C and
didn't understand this incomplete documentation:
https://dlang.org/spec/importc.html
How to use ImportC?
I think
On Thursday, 3 March 2022 at 19:28:36 UTC, matheus wrote:
I'm a simple man who uses D with the old C mentality:
import std.stdio;
void main(){
string s, str = "4A0B1de!2C9~6";
foreach(i;str){
if(i < '0' || i > '9'){ continue; }
s ~= i;
}
writeln("Result: ", s);
On Thursday, 3 March 2022 at 12:14:13 UTC, BoQsc wrote:
I've looked around and it seems using regex is the only closest
solution.
I'm a simple man who uses D with the old C mentality:
import std.stdio;
void main(){
string s, str = "4A0B1de!2C9~6";
foreach(i;str){
if(i < '0' ||
I saw the new feature called ImportC, it's cool to be able to use
C code/libraries, but I'm not much experience in C and didn't
understand this incomplete documentation:
https://dlang.org/spec/importc.html
How to use ImportC?
On Thursday, 3 March 2022 at 13:55:47 UTC, BoQsc wrote:
On Thursday, 3 March 2022 at 13:25:32 UTC, Stanislav Blinov
wrote:
On Thursday, 3 March 2022 at 12:14:13 UTC, BoQsc wrote:
I need to check if a string contains integers,
and if it contains integers, remove all the regular string
characte
On Thursday, 3 March 2022 at 13:25:32 UTC, Stanislav Blinov wrote:
auto filtered = () {
auto r = args[1].find!isNumber; // check if a
string contains integers
```
**When using ```find!isNumber```:**
```
0123456789
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
`abcdefghijklmnop
On Thursday, 3 March 2022 at 13:25:32 UTC, Stanislav Blinov wrote:
On Thursday, 3 March 2022 at 12:14:13 UTC, BoQsc wrote:
I need to check if a string contains integers,
and if it contains integers, remove all the regular string
characters.
I've looked around and it seems using regex is the on
On Thursday, 3 March 2022 at 12:14:13 UTC, BoQsc wrote:
I need to check if a string contains integers,
and if it contains integers, remove all the regular string
characters.
I've looked around and it seems using regex is the only closest
solution.
```d
import std.stdio;
import std.algorithm
I need to check if a string contains integers,
and if it contains integers, remove all the regular string
characters.
I've looked around and it seems using regex is the only closest
solution.
```
import std.stdio;
void main(string[] args){
if (args.length > 1){
On Tuesday, 1 March 2022 at 15:37:55 UTC, Ali Çehreli wrote:
On 3/1/22 07:19, Mike Parker wrote:
> On Tuesday, 1 March 2022 at 13:15:09 UTC, meta wrote:
>
>>
>> enum Color
>> { GRAY }
>>
>> void setColor(Color color);
>>
>> setColor(GRAY);
>
> Then that defeats the purpose of havi
20 matches
Mail list logo