开发者

String classes concept in any language [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help cent开发者_C百科er. Closed 11 years ago.

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';
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜