Kode fungsi css compress opsi normal
Option ExplicitContoh penggunaan css compress opsi normal
Function CSSCompressNormal(sText As String) As String
Dim sTextCSS As String
Dim arrCSS() As String
Dim i As Integer
sTextCSS = sText
sTextCSS = Replace(sTextCSS, " ", "")
sTextCSS = Replace(sTextCSS, vbCrLf, "")
sTextCSS = Replace(sTextCSS, "}", "}" & vbCrLf)
sTextCSS = Replace(sTextCSS, "*/", "*/" & vbCrLf)
arrCSS = Split(sTextCSS, vbCrLf)
sTextCSS = ""
For i = LBound(arrCSS) To UBound(arrCSS)
If arrCSS(i) <> "" Then
sTextCSS = sTextCSS & arrCSS(i) & vbCrLf
End If
Next
CSSCompressNormal = sTextCSS
End Function
Private Sub Command1_Click()
Text1.Text = CSSCompressNormal(Text1.Text)
End Sub