Sunday, 17 May 2015
Remove Extra White Space Or Tabs CODE


---------------------------------------------------------------------------------------------------------------------
COPY AND PASTE CODE POST HTML SECTION
---------------------------------------------------------------------------------------------------------------------
<div dir="ltr" style="text-align: left;" trbidi="on">
<html>
<head>
<title>LINE BREAK REMOVER TOOL </title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type='text/javascript'>
function removeSpaces(){
var nospaces = document.getElementById("nospaces").checked;
var notabs = document.getElementById("notabs").checked;
var nsText = document.getElementById("oldText").value;
nsText = nsText.replace(/(\n\r|\n|\r)/gm,"<1br />");
if(nospaces == 1 || nospaces == true){
nsText = nsText.replace(/\t/g,"");
}else{
nsText = nsText.replace(/\t/g," ");
}
re1 = /\s+/g;
nsText = nsText.replace(re1," ");
re2 = /\<1br \/>/gi;
nsText = nsText.replace(re2, "\n");
document.getElementById("newText").value = nsText;
}
//]]>
</script>
<style type="text/css">
h2 {
color:#E86032;
font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
font-size:18px;
margin:0;
padding:8px 0;
}
/* CONTENT */
.flat{margin:0;padding:0;}
.online-tools{margin:0 0 20px 0;padding:20px; border: 1px dashed #999999;background-color:#dfecfa;clear:both;-moz-border-radius: 12px;border-radius: 12px;}
.resourcelist{margin: 0 0 2% 0;padding:2%;border:1px solid #4592d4;-webkit-border-radius: 12px;-moz-border-radius: 12px;border-radius: 12px;}
.mright{margin-right:20px;}
.mbottom{margin-bottom:15px;}
.clb{clear:both;}
.tfquote{font-style:italic;color:#7e7f80;font-size:16px;padding-left:30px;padding-right:30px;}
.hpagebox{float:right;margin: 15px 0 20px 10px;padding:20px 20px;width:242px;border:1px solid #4592d4;-webkit-border-radius: 12px;-moz-border-radius: 12px;border-radius: 12px;}
.hpagebox h2{font-size: 21px;color: #3b6e9a;margin-bottom:0;padding-bottom:4px;}
.hpagebox p{font-size: 15px;margin-top:0;padding-top:0;}
.hpagelist li{line-height:23px;}
hr{margin:15px 0; padding:0;height: 1px;background-color: #ea6f15;border:none}
.fleft{float:left;padding: 5px 10px 5px 0px;}
.fright{float:right;padding: 5px 0px 5px 10px;}
.code{font-family:courier,sans-serif;color: #031f0c;padding:20px 10px;border-top: 2px dotted #cccccc;border-bottom: 2px dotted #cccccc;}
.cmt{font-family:courier,sans-serif;color: #006633;}
/* FORMS */
form{padding:0;margin:0;}
textarea{width:99%;margin:0;padding:0;}
form h2{margin:0;padding:0;}
.frmbtn{margin: 0 0 20px 0;padding:6px 9px;color:#006699;font-size:15px;cursor:pointer;}
button{cursor:pointer;}
</style>
</head>
<body>
<div id="wrapper">
<div id="main">
<div id="content">
<h2 id="tools">
Remove Extra Whitespace or Tabs</h2>
<div class="adleft">
<form method="post" action="remove-white-spaces.php" class="online-tools">
<h2>Remove Extra Whitespace or Tabs</h2>
<p>Paste your text in the box below and then click the button to <strong>trim whitespace</strong> characters.</p>
<p>The new text will appear in the box at the bottom of the page.</p>
<p class="flat"><input type="radio" id="nospaces" name="nospaces" value="no" checked="checked" /> Replace whitespaces with a single space but delete all tabs</p>
<p class="flat"><input type="radio" id="notabs" name="nospaces" value="no" /> Replace both multiple whitespaces and tabs with a single space</p>
<p><textarea id="oldText" name="oldText" rows="6" cols="36"></textarea></p>
<p><input type="button" name="Remove-White-Spaces" value="Replace Whitespaces" onclick="javascript:removeSpaces()" class="frmbtn" /></p>
<h2>New Text without Extra Whitespace</h2>
<p class="flat">Copy your new text from the box below.</p>
<p><textarea id="newText" name="newText" rows="9" cols="36" onclick="javascript:this.form.newText.focus();this.form.newText.select();"></textarea></p>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
</div>
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment