Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

xanburzum

Remover Itens De Uma Querystring

Recommended Posts

Function RemoveritensQueryString(ByVal OriginalQS, ByVal RemoveItem)
   If OriginalQS = "" Then Exit Function
   If RemoveItem = "" Then Exit Function
   Dim newQS: newQS = ""
   tmpQS = Split(OriginalQS ,"&")
   For i=0 To UBound(tmpQS)
   tmpPair = Split(tmpQS(i),"=")
   If Trim(tmpPair(0)) <> Trim(RemoveItem) Then
   If Trim(newQS) <> "" Then newQS = newQS &"&"
   newQS = newQS & tmpPair(0) &"="& tmpPair(1)
   End If
   Next
   RemoveritensQueryString= newQS
   End Function

 

 

Exemplo:

 

currentQs = "a=2&b=3&c=4&d=5"

newQs = RemoveritensQueryString(currentQs,"c")

response.write newQs

resultado a=2&b=3&d=5

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.