Nodejs String Case Convert toAkaLowerCase()

Here you can find the source of toAkaLowerCase()

Method Source Code

String.prototype.toAkaLowerCase = function() {

      var integer=0,i;
      var newString="";

      for(i=0;i<this.length;i++){

         var integer = this.charCodeAt(i);

         if(integer>=65 && integer<=90){
            integer=integer+32;//from w  ww  . j  a  v a  2s. c o m
            newString=newString+String.fromCharCode(integer);
         }
         else{
            newString=newString+String.fromCharCode(integer);
         }
      }

      return newString;

   };

Related

  1. toAkaUpperCase()
    String.prototype.toAkaUpperCase = function() {
      var integer=0,i;
      var newString="";
      for(i=0;i<this.length;i++){
        var integer = this.charCodeAt(i);
        if(integer>=97 && integer<=122){
          integer=integer-32;
          newString=newString+String.fromCharCode(integer);
        else{
          newString=newString+String.fromCharCode(integer);
      return newString;
    };
    
  2. toAlternatingCase()
    String.prototype.toAlternatingCase = function() {
      return [...this].map(
        (c) => (c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase()),
      ).join``;
    };
    
  3. toAlternatingCase()
    String.prototype.toAlternatingCase = function () {
      var _str = ""; 
      for(var _c = 0; _c < this.length; _c++){
        _str += ((this[_c] === this[_c].toUpperCase())? this[_c].toLowerCase() : this[_c].toUpperCase());
      return _str;
    
  4. toAlternatingCase()
    String.prototype.toAlternatingCase = function () {
      var result = [];
      var letters = this.split("");
      letters.forEach(function(char) {
        if ((char.charCodeAt(0) >= 97) && (char.charCodeAt(0) <= 122)) {
          result.push(char.toUpperCase());
        } else if ((char.charCodeAt(0) >= 65) && (char.charCodeAt(0) <= 90)){
          result.push(char.toLowerCase());
        } else {
    ...