字符串查找


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58
DECLARE @iniTel VARCHAR(100),@split VARCHAR(20),@next INT,@position INT,@nextPosition int
SET @iniTel = '13737150298/15018747329'
set @iniTel=ltrim(rtrim(@iniTel))
SET @split = '/'
SET @next = 0
SET @position=1
WHILE ( @position < LEN(@iniTel) )
BEGIN
    SET @nextPosition = CHARINDEX(@split,@iniTel,@position)
    IF (@nextPosition = 0 OR @nextPosition IS NULL) SELECT @nextPosition = LEN(@iniTel) +1
    SELECT SUBSTRING(@iniTel, @position, @nextPosition - @position)
    SELECT @position = @nextPosition+1
END