如何使用组合从资源文件中读取值 [英] how to read value from resource file using combinations

查看:71
本文介绍了如何使用组合从资源文件中读取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从资源文件中读取值并结合使用.我创建了一个资源文件,其中包含从0到9的Marathi数字.现在,我读取此数字,例如10 11,它使用数字组合.我最多可以读到9,但是如何使用资源文件中的值组合来阅读.

还有没有附加的其他方法吗?

请帮帮我.

非常感谢.

I want to read value from resource file with combination. I create one resource file which contains Marathi digits from 0 to 9. Now I read this digits like 10 11 that is using combination of digits. I read it up to 9 but how to read with combination of values in resource file.

Is there is other way without append?

Please help me.

Thanks a lot.

推荐答案

好吧,如果数字组合对您有用,以便从1& ;;定义10、11左右. 0,那么您可以执行以下操作:
Well if the combination of digits would work for you in order to define 10, 11 or so from 1 & 0 then you can do somthing like:
Resources.GetString("One"); // for 1
Resources.GetString("Zero"); // for 0
Resources.GetString("One") + Resources.GetString("Zero"); // for 10
Resources.GetString("One") + Resources.GetString("One"); // for 11



不过,我不建议您做这样的事情.这不是标准的方法,也不是正确的方法.通常,字符串是本地化的.当您安装特定语言的MUI(在您的情况下为Marathi MUI)时,数字和数据类型的内容由OS本身进行了本地化

对于字符串,如果它们表示正确,则可以确保进行串联.通常,两个词分别可能意味着不同,而将两个词组合在一起可能意味着完全不同.因此,请调查逻辑并根据需要进行实施.



Though, I would not suggest you to do something like this. This is not the standard way nor a right one. Generally, strings are localized. Numbers and data kind of thing are localized by OS itself when you install a particular language MUI (Marathi MUI in your case)

For strings, you can sure go for concatenation if they mean correctly. Generally, two words separately might mean different and combining the two might mean totally different. So, look into the logic and need, implement accordingly.


这篇关于如何使用组合从资源文件中读取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆