repl.it
@anonymous/IllustriousWellgroomedRedpoll
JavaScript

No description

var the_name = "Luke Skywalker";

// access the string
console.log( "The name is " + the_name );

// access an attribute of the string
console.log( "The length of name is " + the_name.length );

// access a method of the string
res = "";
if ( the_name.indexOf( "Skywalker" ) === -1 ) {
    res = "not "
}
console.log( "This person is " + res + "from House Skywalker" );

if ( the_name.indexOf( "Luke" ) > -1 ){
    the_name = the_name.replace("Luke", "Master Luke");
} else if ( the_name.indexOf( "Anakin" ) > -1 ) {
    the_name = the_name.replace("Anakin Skywalker", "Darth Vader");
} else if ( the_name.indexOf( "Leia" ) > -1 ) {
    the_name = the_name.replace("Leia", "Princess Leia");
}
console.log( the_name );
Native Browser JavaScript