0% found this document useful (0 votes)
5 views3 pages

STR Method

The document contains an HTML page with JavaScript functions for various string manipulation methods, including trimming, converting to uppercase/lowercase, character extraction, concatenation, and more. It features a user interface with input fields and buttons to execute these string methods. The layout is divided into two sections for better organization of input and output displays.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

STR Method

The document contains an HTML page with JavaScript functions for various string manipulation methods, including trimming, converting to uppercase/lowercase, character extraction, concatenation, and more. It features a user interface with input fields and buttons to execute these string methods. The layout is divided into two sections for better organization of input and output displays.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

<%--

Document : string_methods
Created on : 19 Jun, 2025, [Link] PM
Author : Mrunali
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>String methods</title>

<script type="text/javascript">
function trim_str(){
const a = [Link]("name").value;
const b = [Link]();
[Link]("msg").value = b;
[Link](b);
}
function touppercase(){
const a = [Link]("name").value;
const b = [Link]();
[Link]("msg").innerHTML= b;
[Link]("msg").value = b;
[Link](b);
}
function tolowercase(){
const a = [Link]("name").value;
const b = [Link]();
[Link]("msg").innerHTML= b;
[Link]("msg").value = b;
[Link](b);
}
function charat(){
const a = [Link]("name").value;
const b = [Link]("str").value;
const c = [Link](parseInt(b));
[Link]("msg").innerHTML= c;
[Link]("msg").value = c;
[Link](b);
}
function concate(){
const a = [Link]("name").value;
const b = [Link]("str").value;
const c = [Link](" ",b);
[Link]("msg").innerHTML= c;
[Link]("msg").value = c;
}
function indexof(){
const a = [Link]("name").value;
const b = [Link]("str").value;
const c = [Link](b);
[Link]("msg").innerHTML= c;
[Link]("msg").value = c;
}
function lastindexof(){
const a = [Link]("name").value;
const b = [Link]("str").value;
const c = [Link](" ",b);
[Link]("msg").innerHTML= c;
[Link]("msg").value = c;
}
function slice_str(){
const a = [Link]("name").value;
const b = [Link]("str").value;
const c = [Link]("str").value;
const d = [Link](parseInt(b),parseInt(c));
[Link]("msg").innerHTML= d;
[Link]("msg").value = d;
}
function replacement(){
const a = [Link]("name").value;
const b = [Link]("str").value;
const c = [Link]("str").value;
const d = [Link](b,c);
[Link]("msg").innerHTML= d;
[Link]("msg").value = d;
}
function split_str(){
cconst a = [Link]("name").value;
const b = [Link]("str").value;
const d = [Link](""+b+"");
[Link]("msg").innerHTML= d;
[Link]("msg").value = d;
}
</script>
<style>
.left{
width: 50%;
float: left;
background-color: lightgrey;
text-align:center;
padding : 30px;
}
.right{
width: 50%;
float: right;
background-color: lightblue;
text-align:center;
padding: 30px;
}
</style>
</head>
<body>
<div width="100%">
<div class="left">
<input type="text" size="20px" placeholder="input" id="name">
<hr>
<input type="text" size="20px" placeholder="input" id="str">
<hr>
<input type="text" size="20px" placeholder="Output" id="msg">
<hr>
<button onClick="trim_str()" style="background-color:
yellow">Trim</button>
<hr>
<button onClick="touppercase()" style="background-color:
red">touppercase</button>
<hr>
<button onClick="tolowercase()" style="background-color:
green">tolowercase</button>
<hr>
<button onClick="charat()" style="background-color:
gray">charat</button>
<hr>
<button onClick="concate()" style="background-color:
gold">concate</button>
<hr>
<button onClick="indexof()" style="background-color:
wheat">indexof</button>
<hr>
<button onClick="lastindexof()" style="background-color:
burlywood">lastindexof</button>
</div>
<div class="right">
<input type="text" size="20px" placeholder="input string"
id="name">
<hr>
<input type="text" size="20px" placeholder="input" id="str">
<hr>
<input type="text" size="20px" placeholder="input" id="str1">
<hr>
<input type="text" size="20px" placeholder="Output" id="msg">
<hr>
<button onClick="slice_str()" style="background-color:
blue">slice</button>
<hr>
<button onClick="replacement()" style="background-color:
silver">replace</button>
<hr>
<button onClick="split_str()" style="background-color:
pink">split</button>
</div>
</div>
<div id="msg"></div>
</body>
</html>

You might also like