Find a char among string (string.findAmong.char)

rassoc rassoc at rassoc.org
Tue Jul 6 15:48:35 UTC 2021


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
}
```


More information about the Digitalmars-d-learn mailing list