Visual Basic - Funcion Rtrim

Life is soft - evento anual de software empresarial
 
Vista:

Funcion Rtrim

Publicado por Nicolai Cardenas (1 intervención) el 04/09/2001 17:20:32
Quisiera tener el codigo de la funcion Rtrim.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Funcion Rtrim

Publicado por afogutu (321 intervenciones) el 04/09/2001 17:55:39
RTRIM QUITA LOS ESPACIOS VACIOS A DERECHA DE UNA CADENA

POR EJEMPLO

VARIABLE = "HOLA AMIGOS "

VARIABLE = RTRIM(VARIABLE)

RESULTADO = "HOLA AMIGOS"

TAMBIEN PODES USAR LTRIM QUE ES IGUAL PERO CON ESPACIOS A IZQUIERDA.

RTRIM SIEMPRE DEVUELVE UN RESULTADO ASI SEA QUE NO REALIZE NINGUNA OPERACIÓN

AFOGUTU.

Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Funcion Rtrim

Publicado por Javier Pérez (170 intervenciones) el 04/09/2001 17:57:37
Aquí tienes una posibilidad:

Function FuncRTrim(ByVal strParam As String) As String

Dim pos As Integer
Dim espacioBlanco As Boolean

pos = Len(strParam)
espacioBlanco = True
While (pos >= 1) And espacioBlanco
If Mid$(strParam, pos, 1) = " " Then
pos = pos - 1
Else
espacioBlanco = False
End If
Wend

FuncRTrim = Mid(strParam, 1, pos)

End Function
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar