Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/07/2005, 18:02
Avatar de u_goldman
u_goldman
Moderador
 
Fecha de Ingreso: enero-2002
Mensajes: 8.031
Antigüedad: 23 años, 4 meses
Puntos: 98
Código:
Function CortaTexto(strTexto, intLongitud, separador)
	if len(strTexto) > intLongitud then
		Dim count
		Dim strTemp
		Dim j
		strTemp = ""
		count = 0
		for j =0 to len(strTexto)
			strTemp = strTemp & mid(strTexto, j + 1, 1)
			count = count + 1
			if count = intLongitud then
				strTemp = strTemp & separador
				count = 0
			end if
		next
		CortaTexto = strTemp
	else
		CortaTexto = strTexto
	end if
End Function
strFrase = "Tengo mucha sed, pienso ir por unas cervezas"
Response.Write CortaTexto(strFrase, 21, "<br>")
Salu!
__________________
"El hombre que ha empezado a vivir seriamente por dentro, empieza a vivir más sencillamente por fuera."
-- Ernest Hemingway