0

I'm checking to see if a special character such as !@#$ has been put in to an inputted phrase. I'm currently using isLowerCase, isUpperCase, and isDigit but I was wondering if there was a isSpecialCharacter. its for a simple ceaser cypher encryption I'm toying with. Below is what im doing for Upper case letters.

Ive read the template proposals and googled it but cant find anything

if(Character.isUpperCase(u))
{
    u=u+(3%26);

    if(u>'Z')
        u=u-26;
    }
}
Derek Pollard
  • 6,953
  • 6
  • 39
  • 59
J WALKAZ
  • 61
  • 5
  • 2
    There is no universal agreement on what "special character" means. In this Unicode world, there are tens of thousands of characters. Which ones are "special"? You have to create your own criteria and write your own test. – Pointy May 08 '19 at 02:36
  • See: https://stackoverflow.com/questions/2402886/javascript-find-if-english-alphabets-only – NoChance May 08 '19 at 03:38

1 Answers1

0

Character.test(/[!@#$%^&\*\(\)-\+]/) or something of the sort

Michael Ossig
  • 205
  • 2
  • 9