zoukankan      html  css  js  c++  java
  • vb 去掉html中的回车和tab;转换部分html大写标签为小写

    '//去掉各种回车空格符  

    Public Function replaceEnter(bStr As String)  

        bStr = Replace(bStr, " ", "")  

        bStr = Replace(bStr, vbTab, "")  

        bStr = Replace(bStr, vbCrLf, "")  

        bStr = Replace(bStr, Chr(13) + Chr(10), "")  

        bStr = Replace(bStr, Chr(13), "")  

        bStr = Replace(bStr, Chr(10), "")  

        replaceEnter = bStr  

    End Function  

    '//网页标签改为小写  

    Public Function htmlLableToSmall(strHtml As String)  

        strHtml = Replace(strHtml, "<A", "<a")  

        strHtml = Replace(strHtml, "</A", "</a")  

        strHtml = Replace(strHtml, "<SPAN", "<span")  

        strHtml = Replace(strHtml, "</SPAN", "</span")  

        strHtml = Replace(strHtml, "<DIV", "<div")  

        strHtml = Replace(strHtml, "</DIV", "</div")  

        strHtml = Replace(strHtml, "<UL", "<ul")  

        strHtml = Replace(strHtml, "</UL", "</ul")  

        strHtml = Replace(strHtml, "<LI", "<li")  

        strHtml = Replace(strHtml, "</LI", "</li")  

        strHtml = Replace(strHtml, "<IMG", "<img")  

        strHtml = Replace(strHtml, "</IMG", "</img")  

        strHtml = Replace(strHtml, "<P", "<p")  

        strHtml = Replace(strHtml, "</P", "</p")  

        strHtml = Replace(strHtml, "<STRONG", "<strong")  

        strHtml = Replace(strHtml, "</STRONG", "</strong")  

        strHtml = Replace(strHtml, "<EM", "<em")  

        strHtml = Replace(strHtml, "</EM", "</em")  

        strHtml = Replace(strHtml, "<DL", "<dl")  

        strHtml = Replace(strHtml, "</DL", "</dl")  

        strHtml = Replace(strHtml, "<DD", "<dd")  

        strHtml = Replace(strHtml, "</DD", "</dd")  

        strHtml = Replace(strHtml, "<DT", "<dt")  

        strHtml = Replace(strHtml, "</DT", "</dt")  

        strHtml = Replace(strHtml, "<B", "<b")  

        strHtml = Replace(strHtml, "</B", "</b")  

        htmlLableToSmall = strHtml  

    End Function  

  • 相关阅读:
    基于node.js+socket.io+html5实现的斗地主游戏(1)概述
    [javascript]switchTab:仿腾讯首页Tab栏切换js插件
    [js]利用闭包向post回调函数传参数
    [CSS]利用伪元素实现一些特殊图形 from baidu校招
    [javascript]模块化&命名污染—from 编程精解
    [随手记]2014前端面试题解
    [IE bug] ajax请求 304解决方案
    [java]基于UDP的Socket通信Demo
    [JQuery]ScrollMe滚动特效插件
    java.lang.OutOfMemoryError及解决方案
  • 原文地址:https://www.cnblogs.com/yf1019091807/p/5831173.html
Copyright © 2011-2022 走看看