//取字符串拼音首字母 function makePy(str) { if (typeof(str) != "string") throw new Error(-1, "函数makePy需要字符串类型参数!"); var arrResult = new Array(); //保存中间结果的数组 for (var i = 0, len = str.length; i < len; i++) { //获得unicode码 var ch = str.charAt(i
去除字符串中的html标记及标记中的内容 --1.创建函数 create function [dbo].[clearhtml] (@maco varchar(8000)) returns varchar(8000) as begin declare @i int while 1 = 1 begin set @i=len(@maco) set @maco=replace(@maco, substring(@maco,charindex('<',@maco), charindex('>',@mac
//将edit1中的每个字符串改为首字母大写 procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);begin with Sender as Tedit do if (text = '') or (text[selstart] = ' ') or ( sellength = length( text ) )then if Key in ['a'..'z'] then Key := Upcase(Key)
// a:列数 bool:排序升序判断参数 true false Str:支持多列 function newUnitSort(a, bool, str) { var oTable = document.getElementById('ATEST'); var arr = []; for (var i = 0; i < oTable.tBodies[0].rows.length; i++) { arr[i] = oTable.tBodies[0].rows[i]; } if (bool) { if
近日在做项目的时候,经常会在页面上处理一些数据.结果发现自己js掌握的并不是很好.那就在这里记录js的点点滴滴吧. 1. 去除字符串中的 html 标签 function delHtmlTag(str){ return str.replace(/<[^>]+>/g,""); } var str = "<span style='display:none;'>This is test</span><br/>"; st