数据库字段名转换成Java字段名

将数据库字段名转换成Java字段名

 

比如:

CREATED_DATE

CREATED_BY

UPDATED_DATE

UPDATED_BY

 

转换成:

createdDate

createdBy

updatedDate

updatedBy

 

<html> 
	<head> 
	<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "> 
	<title> Capital Word </title> 
	<script>
		function zm_shouzimudaxie(){
			zm_tihuanneirong( document.getElementById("zm_neirong").value.replace(/\b\w+\b/g,function(a){return a.substring(0,1).toUpperCase() + a.substring(1) }))
		}
		
		
		function zm_shouzimuxiaoxie(){
			zm_tihuanneirong( document.getElementById("zm_neirong").value.replace(/\b\w+\b/g,function(a){return a.substring(0,1).toLowerCase()+a.substring(1) }))
		}
		
		function zm_quanbudaxie(){zm_tihuanneirong(document.getElementById("zm_neirong").value.toUpperCase())}
		function zm_quanbuxiaoxie(){zm_tihuanneirong(document.getElementById("zm_neirong").value.toLowerCase())}
		function zm_tihuanneirong(a){document.getElementById("zm_neirong").value=a;}
		
		function zm_javafeild(){
			//zm_tihuanneirong( document.getElementById("zm_neirong").value.replace(/(\b|_)[a-zA-Z0-9]+(\b|_)/g,function(a){return a.substring(0,1).toLowerCase()+a.substring(1).toUpperCase() }))
			zm_tihuanneirong( document.getElementById("zm_neirong").value.replace(/\_/g," ") );
			//str.replace(/\-/g,"!")
			
			
			zm_tihuanneirong( document.getElementById("zm_neirong").value.replace(/\b\w+\b/g,function(a){return a.substring(0,1).toUpperCase()+a.substring(1).toLowerCase() }) );
			zm_tihuanneirong( document.getElementById("zm_neirong").value.replace(/ /g,"") );
			zm_shouzimuxiaoxie();
		}
		
	</script>
	
	</head> 

	<body > 
	<div align="center">
	<textarea id="zm_neirong" style="border: 1px solid #d9d9d9;height: 160px;width: 95%;"></textarea>
	<br /><br />
		<input type="button" value="转换为大写" οnclick="zm_quanbudaxie();" />  
		<input type="button" value="转换为小写" οnclick="zm_quanbuxiaoxie();" />  
		<input type="button" value="转换首字母为大写" οnclick="zm_shouzimudaxie();" />
		<input type="button" value="转换首字母为小写" οnclick="zm_shouzimuxiaoxie();" />
		
		<input type="button" value="转换db字段为java feild名" οnclick="zm_javafeild();" />
		
	</div>

	</body> 
</html> 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值