Program #2 – write a java script program to count the number of capital & small characters in a given string

Given a string that can alphanumeric, special characters, manipulate the string as follows:

  1. Reverse the string completely
  2. Change capital characters to small and small to capital.
  3. Capitalise the entire string
  4. Replace alphabets in the string using as follows: “a-> b, b->c, c->d, …z->a irrespective whether they are capital or not

Description: Please note the below example is just for the first question mentioned above, make sure to do the same for the rest of the questions.

Reverse the string completely

PossibilitiesInputOutput
Consider a string with many words“The quick brown Fox jumps over a lazy Dog”goD yzal a revo spmuj xoF nworb kciuq ehT
Consider a string with just a word (with Caps, Small, Special chars, Numbers)“Hello@2022!”  !2202@olleH  
Consider a string with just number“123456789”987654321
Consider a palindrome string/word“Testset” “madam, I’m adam“testset mada m’i madam

Note: Please document all these in a file (file name has to be “TestData Program-2”) in your given shared drive.

Scroll to Top