WordOnlyMeth.cs 511 B

1234567891011121314151617181920212223
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Text.RegularExpressions;
  7. namespace WpfApp1.Methods
  8. {
  9. public class WordOnlyMeth
  10. {
  11. public bool WordOnly(string text)
  12. {
  13. Regex regex = new Regex("[^А-Яа-яЁё]+");
  14. bool check = regex.IsMatch(text);
  15. if (check == true)
  16. {
  17. return false;
  18. }
  19. return true;
  20. }
  21. }
  22. }