Código: Seleccionar todo
$text = StringReplace("123", "1", "h")
MsgBox(0, "Remplazar", $text)
pero como haria para remplazar el 2 y el 3 como por ejemplo 2=p y 3=f para que me presente el siguieente resultado 123=hp3
Código: Seleccionar todo
$text = StringReplace("123", "1", "h")
MsgBox(0, "Remplazar", $text)
Código: Seleccionar todo
$text = StringReplace("123", "1", "h")
$text = StringReplace($text , "2", "p")
$text = StringReplace($text , "3", "f")
ConsoleWrite($text & @CRLF)
Código: Seleccionar todo
$cadena = "2152938742593812341"
$res = ""
For $i = 1 To StringLen($cadena)
$caracter = StringMid($cadena, $i, 1)
Switch $caracter
Case "1"
$caracter = "h"
Case "2"
$caracter = "p"
Case "3"
$caracter = "f"
EndSwitch
$res &= $caracter
Next
ConsoleWrite($res & @CRLF)
Código: Seleccionar todo
$cadena = "HOL hol"
$res = ""
For $i = 1 To StringLen($cadena)
$caracter = StringMid($cadena, $i, 1)
Switch $caracter
Case "H"
$caracter = "p"
Case "O"
$caracter = "a"
Case "L"
$caracter = "r"
;Ahora con las minusculas
Case "h"
$caracter = "P"
Case "o"
$caracter = "A"
Case "l"
$caracter = "R"
EndSwitch
$res &= $caracter
Next
ConsoleWrite($res & @CRLF)
Código: Seleccionar todo
$cadena = "HOL hol"
$res = ""
For $i = 1 To StringLen($cadena)
$caracter = StringMid($cadena, $i, 1)
Select
Case $caracter == "H"
$caracter = "p"
Case $caracter == "O"
$caracter = "a"
Case $caracter == "L"
$caracter = "r"
;Ahora con las minusculas
Case $caracter == "h"
$caracter = "P"
Case $caracter == "o"
$caracter = "A"
Case $caracter == "l"
$caracter = "R"
EndSelect
$res &= $caracter
Next
ConsoleWrite($res & @CRLF)
Código: Seleccionar todo
$cadena = "HOL hol"
$res = ""
For $i = 1 To StringLen($cadena)
$caracter = Asc(StringMid($cadena, $i, 1))
Switch $caracter
Case Asc("H")
$caracter = "p"
Case Asc("O")
$caracter = "a"
Case Asc("L")
$caracter = "r"
;Ahora con las minusculas
Case Asc("h")
$caracter = "P"
Case Asc("o")
$caracter = "A"
Case Asc("l")
$caracter = "R"
Case Else
$caracter = Chr($caracter)
EndSwitch
$res &= $caracter
Next
ConsoleWrite($res & @CRLF)