• [标量函数] Html标记过滤 HtmlFilter


    /****** Object:  UserDefinedFunction [dbo].[HtmlFilter]    Script Date: 11/30/2010 14:39:30 ******/
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    -- =============================================
    -- Author:		MK
    -- Create date: 2010-11-30
    -- Description:	去除Html标记
    -- =============================================
    CREATE FUNCTION [dbo].[HtmlFilter]
    (
    	@INPUT VARCHAR(MAX)
    )
    RETURNS VARCHAR(MAX)
    AS
    BEGIN
    	DECLARE @A INT;
    	DECLARE @B INT;
    	DECLARE @S VARCHAR(MAX);
    	SET @S = @INPUT;
    	
    	WHILE CHARINDEX('<', @S, 0) > 0 BEGIN
    		SET @A = CHARINDEX('<', @S, 0);
    		SET @B = CHARINDEX('>', @S, @A);
    		IF @B < 1
    			SET @S = SUBSTRING(@S, 0, @A);
    		ELSE
    			SET @S = SUBSTRING(@S, 0, @A) + SUBSTRING(@S, @B + 1, LEN(@S) - @B);
    	END
    	RETURN @S;
    END
    
    GO
    

  • 相关阅读:
    Alpha冲刺Day10
    Alpha冲刺Day9
    Alpha冲刺Day8
    Alpha冲刺Day7
    Alpha冲刺Day6
    SDN
    【Alpha
    【Alpha】团队课程展示
    【Alpha】团队项目测试报告与用户反馈
    【Alpha】总结
  • 原文地址:https://www.cnblogs.com/muse/p/1892425.html
Copyright © 2020-2023  润新知