Skip to content

Commit 85f8154

Browse files
committed
Fix typos and update description to include a link
1 parent 199d263 commit 85f8154

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Conversions/UpperCaseConversion.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
/*
2-
Explanation :- a user gives a String (it can be incomplete lower or
3-
partial lower) and then the program would convert it into a
4-
complete(all characters in upper case) upper case string. The
5-
logic we have used in the following program is: All the lower case
6-
characters (a-z) has ASCII value ranging from 97 to 122 and their
7-
corresponding upper case characters (A-Z) have ASCII values 32
2+
Explanation :- A user gives a string (it can be incomplete lowercase or
3+
partially in lowercase) and then the program converts it into a
4+
completely (all characters in uppercase) uppercase string. The
5+
logic we have used in the following program is: All the lowercase
6+
characters (a-z) has [ASCII](https://en.wikipedia.org/wiki/ASCII) value ranging from 97 to 122 and their
7+
corresponding uppercase characters (A-Z) have ASCII values 32
88
lesser than them. For example ‘a‘ has an ASCII value of 97
99
and ‘A‘ has an ASCII value of 65 (97 - 32). The same applies to other
1010
characters.
1111
*/
1212

1313
/**
14-
* UpperCaseConversion takes any case-style string and converts it to the upper case-style string.
15-
* @param {String} inputString any case style string
16-
* @returns {String} upper case string
14+
* UpperCaseConversion takes any case-style string and converts it to the uppercase-style string.
15+
* @param {string} inputString Any case style string
16+
* @returns {string} Uppercase string
1717
*/
1818
const UpperCaseConversion = (inputString) => {
1919
// Take a string and split it into characters.
2020
const newString = inputString.split('').map(char => {
2121
// Get a character code by the use charCodeAt method.
2222
const presentCharCode = char.charCodeAt()
23-
// If the character code lies between 97 to 122 it means they are in the lower case so convert it.
23+
// If the character code lies between 97 to 122, it means they are in the lowercase so convert it.
2424
if (presentCharCode >= 97 && presentCharCode <= 122) {
2525
// Convert the case by use of the above explanation.
2626
return String.fromCharCode(presentCharCode - 32)

0 commit comments

Comments
 (0)