跟java里的split函数的用法是很相像的,举例如下: The awk function split(s,a,sep) splits a string s into an awk array a using the delimiter sep. set time = 12:34:56set hr = `echo $time | awk '{split($0,a,":" ); print a[1]}'` # = 12set sec = `echo $time | awk '{split…
一个是分割,一个是连接. 惯例,先看内部帮助文档 Help on method_descriptor: join(...) S.join(iterable) -> string Return a string which is the concatenation of the strings in the iterable. The separator between elements is S. (END) 将可迭代对象(包含的应该是str类型的,不然会报错)连接起来, 返回值是str,用法如…
例1 代码如下 复制代码 create function f_split(@SourceSql varchar(8000),@StrSeprate varchar(10))returns @temp table(a varchar(100))--实现split功能 的函数--date :2003-10-14as begin declare @i int set @SourceSql=rtrim(ltrim(@SourceSql)) set @i=charindex(@StrSeprate,@So…