digitalmars.D.learn - French and Greek strings
- pascal111 (2/2) Nov 16 2021 How can I use types to make string and char variables that hold
- H. S. Teoh (14/16) Nov 16 2021 For strings, just use `string`. :-) D strings are Unicode by default,
- Kagamin (2/2) Nov 17 2021 You can use the string type to hold non-ascii characters. Just a
How can I use types to make string and char variables that hold French and Greek characters?
Nov 16 2021
On Wed, Nov 17, 2021 at 12:58:43AM +0000, pascal111 via Digitalmars-d-learn wrote:How can I use types to make string and char variables that hold French and Greek characters?For strings, just use `string`. :-) D strings are Unicode by default, no further effort is needed to use it. Individual characters are a bit more tricky. Usually you can just use dchar, but keep in mind that a dchar is not always the same thing as an on-screen character. The latter can sometimes be composed of multiple dchars; if for whatever reason you need to handle this distinction, you need to use std.uni.Grapheme. (It's a bad idea to use Grapheme by default, because grapheme segmentation is very expensive and will slow down your program if overused. Don't use it unless you actually need to.) T -- If the comments and the code disagree, it's likely that *both* are wrong. -- Christopher
Nov 16 2021
You can use the string type to hold non-ascii characters. Just a substring of another string.
Nov 17 2021