Prototype-string-strip
提供:Dev Guides
プロトタイプ-strip()メソッド
このメソッドは、文字列から先頭および末尾の空白をすべて削除します。
構文
string.strip();
戻り値
トリムされた文字列を返します。
例
<html>
<head>
<title>Prototype examples</title>
<script type = "text/javascript" src = "/javascript/prototype.js"></script>
<script>
function showResult() {
var str = " Prototype JavaScript ";
alert ("Before strip : " + str );
alert ("After strip : " + str.strip() );
}
</script>
</head>
<body>
<p>Click the button to see the result.</p>
<br/>
<br/>
<input type = "button" value = "Result" onclick = "showResult();"/>
</body>
</html>