String classes concept in any language [closed]
I would like to know if in any language is something like this:
There are often strings that gives to an application at runtime some information that is not of informative but more functional so every character really matters. But if you mistype a single character there is a problem that can be found only in runtime.
So what I would like is a language that would find such a problem in compile time, is there anything that could do the trick in any language?
Thank you.
Congratulations, you just invented a struct
. You shouldn't keep stuff like this in a string, that's what structured data is for.
You mean a mis-typed configuration value? Something like
colour = 'blue';
v.s.
color = 'blue';
精彩评论