Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                
              
            
!

CSS

              
                
              
            
!

JS

              
                
document.write(lowerToUpper_1("Hello World. I Am Here to help YOU!")+"<br />");
document.write(lowerToUpper_2("Hello World. I Am Here to help YOU!")+"<br />");


function lowerToUpper_1(string) {
    // Get the length of the input string
    var len = string.length;

    // Iterate through each character in the input string
    for (var i = 0; i < len; i++) {
        // Check if the current character is lowercase
        if (string[i] === string[i].toLowerCase()) {
            // Extract the characters before and after the current character
            // convert the current character to uppercase
            // concatenate the characters before, the uppercase current character and the characters after
            // Reassign the modified string to the original string
            string = string.substr(0, i) + string[i].toUpperCase() + string.substr(i + 1);
        } else {
            // Extract the characters before and after the current character
            // convert the current character to lowercase
            // concatenate the characters before, the lowercase current character and the characters after
            // Reassign the modified string to the original string
            string = string.substr(0, i) + string[i].toLowerCase() + string.substr(i + 1);
        }
    }
    // Return the modified string
    return string;
}



function lowerToUpper_2(string) {
    // Initialize an empty string to store the result
    let res = "";
    // Iterate through each character in the input string
    for (let i = 0; i < string.length; i++) {
        // Check if the current character is lowercase
        if (string[i] === string[i].toLowerCase()) {
            // Convert the character to uppercase and append it to the result string
            res += string[i].toUpperCase();
        } else {
            // Convert the character to lowercase and append it to the result string
            res += string[i].toLowerCase();
        }
    }
    // Return the result string
    return res;
}


              
            
!
999px

Console