<i id='y2EsQ'><tr id='y2EsQ'><dt id='y2EsQ'><q id='y2EsQ'><span id='y2EsQ'><b id='y2EsQ'><form id='y2EsQ'><ins id='y2EsQ'></ins><ul id='y2EsQ'></ul><sub id='y2EsQ'></sub></form><legend id='y2EsQ'></legend><bdo id='y2EsQ'><pre id='y2EsQ'><center id='y2EsQ'></center></pre></bdo></b><th id='y2EsQ'></th></span></q></dt></tr></i><div id='y2EsQ'><tfoot id='y2EsQ'></tfoot><dl id='y2EsQ'><fieldset id='y2EsQ'></fieldset></dl></div>
  • <small id='y2EsQ'></small><noframes id='y2EsQ'>

  • <legend id='y2EsQ'><style id='y2EsQ'><dir id='y2EsQ'><q id='y2EsQ'></q></dir></style></legend>

        <bdo id='y2EsQ'></bdo><ul id='y2EsQ'></ul>
    1. <tfoot id='y2EsQ'></tfoot>

        检查字符是否是字母

        check if char isletter(检查字符是否是字母)

          <tfoot id='GLm0Z'></tfoot>
        1. <i id='GLm0Z'><tr id='GLm0Z'><dt id='GLm0Z'><q id='GLm0Z'><span id='GLm0Z'><b id='GLm0Z'><form id='GLm0Z'><ins id='GLm0Z'></ins><ul id='GLm0Z'></ul><sub id='GLm0Z'></sub></form><legend id='GLm0Z'></legend><bdo id='GLm0Z'><pre id='GLm0Z'><center id='GLm0Z'></center></pre></bdo></b><th id='GLm0Z'></th></span></q></dt></tr></i><div id='GLm0Z'><tfoot id='GLm0Z'></tfoot><dl id='GLm0Z'><fieldset id='GLm0Z'></fieldset></dl></div>
        2. <small id='GLm0Z'></small><noframes id='GLm0Z'>

            1. <legend id='GLm0Z'><style id='GLm0Z'><dir id='GLm0Z'><q id='GLm0Z'></q></dir></style></legend>

                  <tbody id='GLm0Z'></tbody>
                  <bdo id='GLm0Z'></bdo><ul id='GLm0Z'></ul>
                  本文介绍了检查字符是否是字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我想检查一个字符串是否只包含正确的字母.我为此使用了 Char.IsLetter.我的问题是,当有像 é 或 á 这样的字符时,它们也被认为是正确的字母,这不应该是.

                  i want to check if a string only contains correct letters. I used Char.IsLetter for this. My problem is, when there are chars like é or á they are also said to be correct letters, which shouldn't be.

                  是否有可能将字符检查为正确的字母 A-Z 或 a-z 而没有像 á 这样的特殊字母?

                  is there a possibility to check a char as a correct letter A-Z or a-z without special-letters like á?

                  推荐答案

                  bool IsEnglishLetter(char c)
                  {
                      return (c>='A' && c<='Z') || (c>='a' && c<='z');
                  }
                  

                  您可以将此作为扩展方法:

                  You can make this an extension method:

                  static bool IsEnglishLetter(this char c) ...
                  

                  这篇关于检查字符是否是字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Force JsonConvert.SerializeXmlNode to serialize node value as an Integer or a Boolean(强制 JsonConvert.SerializeXmlNode 将节点值序列化为整数或布尔值)
                  Using JSON to Serialize/Deserialize TimeSpan(使用 JSON 序列化/反序列化 TimeSpan)
                  Could not determine JSON object type for type quot;Classquot;(无法确定类型“Class的 JSON 对象类型.)
                  How to deserialize a JSONP response (preferably with JsonTextReader and not a string)?(如何反序列化 JSONP 响应(最好使用 JsonTextReader 而不是字符串)?)
                  how to de-serialize JSON data in which Timestamp it-self contains fields?(如何反序列化时间戳本身包含字段的JSON数据?)
                  JSON.Net custom contract serialization and Collections(JSON.Net 自定义合约序列化和集合)
                  <tfoot id='ssaE8'></tfoot>
                • <legend id='ssaE8'><style id='ssaE8'><dir id='ssaE8'><q id='ssaE8'></q></dir></style></legend>
                    <i id='ssaE8'><tr id='ssaE8'><dt id='ssaE8'><q id='ssaE8'><span id='ssaE8'><b id='ssaE8'><form id='ssaE8'><ins id='ssaE8'></ins><ul id='ssaE8'></ul><sub id='ssaE8'></sub></form><legend id='ssaE8'></legend><bdo id='ssaE8'><pre id='ssaE8'><center id='ssaE8'></center></pre></bdo></b><th id='ssaE8'></th></span></q></dt></tr></i><div id='ssaE8'><tfoot id='ssaE8'></tfoot><dl id='ssaE8'><fieldset id='ssaE8'></fieldset></dl></div>

                        • <bdo id='ssaE8'></bdo><ul id='ssaE8'></ul>

                            <tbody id='ssaE8'></tbody>
                          • <small id='ssaE8'></small><noframes id='ssaE8'>