• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

AutoIT Funcion LTrim y RTrim "Espacios" [By Pink]

Status
Not open for further replies.

Expermicid

Leech
User
Joined
Oct 23, 2011
Messages
285
Reputation
0
Reaction score
255
Points
63
Credits
0
‎13 Years of Service‎
95%
[lenguaje=autoit]#cs -------------------------------------------------------

AutoIt Version: 3.3.8.1

Author..........: Pink

Script Function...: LTrim "Elimina Los Espacios de lado Izquierdo de una Cadena

Uso..............: LTrim(cadena)

#ce -------------------------------------------------------

$cadena=" Hola Mundo "

;Ejemplo Uso LTrim

msgbox(0,"","-"& Ltrim($cadena)&"-")

;funcion LTrim

func LTrim($string)

local $var

local $i=0

while StringIsAlNum($var)=0

$var=stringmid($string,$i,1)

$i=$i+1

WEnd

$final = stringmid($string,$i-1)

return $final

EndFunc[/lenguaje]

[lenguaje=autoit]#cs -------------------------------------------------------

AutoIt Version: 3.3.8.1

Author..........: Pink

Script Function...: RTrim "Elimina Los Espacios de lado Derecho de una Cadena

Uso..............: RTrim(cadena)

#ce -------------------------------------------------------

$cadena=" Hola Mundo "

;Ejemplo RTrim

msgbox(0,"","-"& Rtrim($cadena)&"-")

;funcion RTrim

func RTrim($string)

local $var

local $len=stringlen($string)

local $i=$len

while StringIsAlNum($var)=0

$var=stringmid($string,$i,1)

$i=$i-1

WEnd

$final = stringmid($string,1,$i+1)

return $final

EndFunc[/lenguaje]

 
Last edited by a moderator:
Status
Not open for further replies.
Back
Top