Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add capitalize to string operation
  • Loading branch information
Henrique Cunha committed Oct 28, 2019
commit 11431100ca03497f4f701754b8965cb374be2920
10 changes: 9 additions & 1 deletion JavaScript_Basics/string_operation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@ console.log(oldBio); // My college is SIESGST. Our seniors and alumnus are best

console.log(bio); // My college is SIESGST. Our seniors and alumnus are best in Mumbai My name is Swapnil Satish Shinde I belong to Computer Science branch

// Output by both the methods is same but string interpolation is more beautiful as we only have to right 1 line for all we want
// Output by both the methods is same but string interpolation is more beautiful as we only have to right 1 line for all we want

/** Capitalizing a string
*
* Here's a simple way to capitalize a string
*/
String.prototype.capitalize = (string) => string.slice(0, 1).toUpperCase() + string.slice(1)
console.log("a casual lower case string")
// Prints out: "A casual lower case string"