navagomeza
Member
- Joined
- Jan 13, 2014
- Messages
- 12
- Programming Experience
- 1-3
Hello,
I would like to ask for help in writing a small check for a string that contains html tags and can contains also JavaScript tags.
I want to be able to check the string and skip any content that is within the <script></script>
I am stripping the html from extra spaces, tabs and line breaks, and some of the html has inline JavaScript, which is not ideal but right now I have to work around it.
Here is en example my small method, and where I would like to add the new check:
Thank you for your help.
navagomeza.
I would like to ask for help in writing a small check for a string that contains html tags and can contains also JavaScript tags.
I want to be able to check the string and skip any content that is within the <script></script>
I am stripping the html from extra spaces, tabs and line breaks, and some of the html has inline JavaScript, which is not ideal but right now I have to work around it.
Here is en example my small method, and where I would like to add the new check:
VB.NET:
Public Shared Function MinifyStringContent(ByVal strContent As String) As String
Dim rtnStringContent As String = ""
If Not IsNothing(strContent) AndAlso strContent <> "" Then
rtnStringContent = strContent.ToString.Replace(vbCrLf, "").Replace(" ", " ").Replace(vbTab, "")
End If
Return rtnStringContent.Trim()
End Function
Thank you for your help.
navagomeza.