大文字を小文字にしアンダースコアで連結する

書式

str = text.underscore()

text : 文字列
str : 変換された文字列

説明

大文字を小文字にしアンダースコアで連結するにはunderscore()を使います。AbCであればab_cに変換されます。また、::は/に変換されます。

サンプルコード [実行]

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<link rel="stylesheet" href="main.css" type="text/css" media="all">
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript"><!--
window.onload = function ()
{
var text ="Namespace::FuRuhata";
var str = text.underscore();
$("result").innerText = str;
$("result").textContent = str;
}
// --></script>
</head>
<body>
<h1>大文字を小文字にしアンダースコアで連結する</h1>
<div id="result"></div>
</body>
</html>