简体   繁体   中英

Verifying that a string contains only letters in C# (if, else function or Regex)

I need this in my code for Caesar Cipher, for encryption and decryption also. I don't know where to put the function in the code. The code should work like this, if I enter the message: "Autumn has come23", to suggest the correct range.

If you need the code, tell me!

这可能就是您要找的。

bool isMatch = Regex.Match(input, @"^[a-z]*$", RegexOptions.IgnoreCase).Success;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM