PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Replace function and UNICODE
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Replaces all the occurrences of a word found in a string by another word.
Note: The initial character string is not modified.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This function is now available for the Windows Phone applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 21 and later
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
InitialString is string = "Abracadabra!"
ReplacedString is string = Replace(InitialString, "a", "o")
Info(ReplacedString) // Displays "Abrococobro!"
Versions 18 and later
WINDEVWEBDEV - Server codeiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App
InitialString is string = "beetroot // apricot // strawberry / melon \ nuts / lemon"
ReplacedString is string = Replace(InitialString, ["//", "/", "\", "\\"], "-")
Trace(ReplacedString) // Displays "beetroot - apricot - strawberry - melon - nuts - lemon"


arrMyArray is array of 4 strings
arrMyArray[1] = "//"
arrMyArray[2] = "/"
arrMyArray[3] ="\"
arrMyArray[4] = "\\"
RemplacedString = Replace(InitialString, arrMyArray, "-")
Trace(ReplacedString) // Displays "beetroot - apricot - strawberry - melon - nuts - lemon"
New in version 18
WINDEVWEBDEV - Server codeiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App
InitialString is string = "beetroot // apricot // strawberry / melon \ nuts / lemon"
ReplacedString is string = Replace(InitialString, ["//", "/", "\", "\\"], "-")
Trace(ReplacedString) // Displays "beetroot - apricot - strawberry - melon - nuts - lemon"


arrMyArray is array of 4 strings
arrMyArray[1] = "//"
arrMyArray[2] = "/"
arrMyArray[3] ="\"
arrMyArray[4] = "\\"
RemplacedString = Replace(InitialString, arrMyArray, "-")
Trace(ReplacedString) // Displays "beetroot - apricot - strawberry - melon - nuts - lemon"
WINDEVWEBDEV - Server codeiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App
InitialString is string = "beetroot // apricot // strawberry / melon \ nuts / lemon"
ReplacedString is string = Replace(InitialString, ["//", "/", "\", "\\"], "-")
Trace(ReplacedString) // Displays "beetroot - apricot - strawberry - melon - nuts - lemon"


arrMyArray is array of 4 strings
arrMyArray[1] = "//"
arrMyArray[2] = "/"
arrMyArray[3] ="\"
arrMyArray[4] = "\\"
RemplacedString = Replace(InitialString, arrMyArray, "-")
Trace(ReplacedString) // Displays "beetroot - apricot - strawberry - melon - nuts - lemon"
Versions 19 and later
WINDEVWEBDEV - Server codeLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App
InitialString is string = "Abracadabra!"
ReplacedString is string = Replace(InitialString, 4, 1, "o")
Trace(ReplacedString) // Displays "Abrocadabra!"
New in version 19
WINDEVWEBDEV - Server codeLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App
InitialString is string = "Abracadabra!"
ReplacedString is string = Replace(InitialString, 4, 1, "o")
Trace(ReplacedString) // Displays "Abrocadabra!"
WINDEVWEBDEV - Server codeLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App
InitialString is string = "Abracadabra!"
ReplacedString is string = Replace(InitialString, 4, 1, "o")
Trace(ReplacedString) // Displays "Abrocadabra!"
Syntax

Replacing a string by another one Hide the details

<Result> = Replace(<Initial String> , <String to Replace> , <New String> [, <Option>])
<Result>: Character string
New character string in which the different replacements have been performed.
<Initial String>: Character string (with quotes)
Character string in which the replacements must be performed (maximum size: 2 GB).
<String to Replace>: Character string (with quotes)
Character string that must be replaced in the initial string.
If this parameter corresponds to an empty string (""), <Result> will correspond to <Initial String>.
<New String>: Character string (with quotes)
Character string that will replace <String to Replace>.
If this parameter corresponds to an empty string (""), all the occurrences of <String to Replace> will be deleted.
<Option>: Optional constant (or combination of constants)
Indicates the characteristics of the search for the word to replace:
WholeWordSearches for the whole word (enclosed in punctuation characters or in space characters)
IgnoreCaseSearches while ignoring the case (lowercase/uppercase characters) and the accented characters.
The search is case sensitive by default: the sought string must have the same case as the string to find in the initial string. To perform a search while ignoring the case, use the IgnoreCase constant.
WEBDEV - Browser code This parameter is not available. The search is case sensitive. The string to replace does not necessarily correspond to a whole world: this string can be part of a word.
Versions 18 and later
WINDEVWEBDEV - Server codeiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App

Replacing a set of strings by a new string Hide the details

<Result> = Replace(<Initial String> , <Array of Strings to Replace> , <New String> [, <Option>])
<Result>: Character string
New character string in which the different replacements have been performed.
<Initial String>: Character string (with quotes)
Character string in which the replacements must be performed (maximum size: 2 GB).
<Array of Strings to Replace>: Array
Array of strings that must be replaced in <Initial String>. This array can correspond to:
  • an Array variable.
  • an array expressed in the following format: [Value1, Value2, ... , Value N].
If this parameter corresponds to an empty string (""), <Result> will correspond to <Initial String>.
<New String>: Character string (with quotes)
Character string that will replace all the strings specified in <Array of Strings to Replace>.
If this parameter corresponds to an empty string (""), all the occurrences of <String to Replace> will be deleted.
<Option>: Optional constant (or combination of constants)
Indicates the characteristics of the search for the words to replace:
WholeWordSearches for the whole word (enclosed in punctuation characters or in space characters)
IgnoreCaseSearches while ignoring the case (lowercase/uppercase characters) and the accented characters.
The search is case sensitive by default: the sought string must have the same case as the string to find in the initial string. To perform a search while ignoring the case, use the IgnoreCase constant.
New in version 18
WINDEVWEBDEV - Server codeiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App

Replacing a set of strings by a new string Hide the details

<Result> = Replace(<Initial String> , <Array of Strings to Replace> , <New String> [, <Option>])
<Result>: Character string
New character string in which the different replacements have been performed.
<Initial String>: Character string (with quotes)
Character string in which the replacements must be performed (maximum size: 2 GB).
<Array of Strings to Replace>: Array
Array of strings that must be replaced in <Initial String>. This array can correspond to:
  • an Array variable.
  • an array expressed in the following format: [Value1, Value2, ... , Value N].
If this parameter corresponds to an empty string (""), <Result> will correspond to <Initial String>.
<New String>: Character string (with quotes)
Character string that will replace all the strings specified in <Array of Strings to Replace>.
If this parameter corresponds to an empty string (""), all the occurrences of <String to Replace> will be deleted.
<Option>: Optional constant (or combination of constants)
Indicates the characteristics of the search for the words to replace:
WholeWordSearches for the whole word (enclosed in punctuation characters or in space characters)
IgnoreCaseSearches while ignoring the case (lowercase/uppercase characters) and the accented characters.
The search is case sensitive by default: the sought string must have the same case as the string to find in the initial string. To perform a search while ignoring the case, use the IgnoreCase constant.
WINDEVWEBDEV - Server codeiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App

Replacing a set of strings by a new string Hide the details

<Result> = Replace(<Initial String> , <Array of Strings to Replace> , <New String> [, <Option>])
<Result>: Character string
New character string in which the different replacements have been performed.
<Initial String>: Character string (with quotes)
Character string in which the replacements must be performed (maximum size: 2 GB).
<Array of Strings to Replace>: Array
Array of strings that must be replaced in <Initial String>. This array can correspond to:
  • an Array variable.
  • an array expressed in the following format: [Value1, Value2, ... , Value N].
If this parameter corresponds to an empty string (""), <Result> will correspond to <Initial String>.
<New String>: Character string (with quotes)
Character string that will replace all the strings specified in <Array of Strings to Replace>.
If this parameter corresponds to an empty string (""), all the occurrences of <String to Replace> will be deleted.
<Option>: Optional constant (or combination of constants)
Indicates the characteristics of the search for the words to replace:
WholeWordSearches for the whole word (enclosed in punctuation characters or in space characters)
IgnoreCaseSearches while ignoring the case (lowercase/uppercase characters) and the accented characters.
The search is case sensitive by default: the sought string must have the same case as the string to find in the initial string. To perform a search while ignoring the case, use the IgnoreCase constant.
Versions 19 and later
WINDEVWEBDEV - Server codeiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App

Replacing a section of string by a new string Hide the details

<Result> = Replace(<Initial String> , <Position> , <Length> , <New String>)
<Result>: Character string
New character string into which the replacement was performed.
<Initial String>: Character string (with quotes)
Character string where the replacement will be performed (maximum size: 2 GB).
<Position>: Integer
Position of the section of string to replace.
<Length>: Integer
Length of the string section to replace.
<New String>: Character string (with quotes)
Character string that will replace the specified string section.
New in version 19
WINDEVWEBDEV - Server codeiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App

Replacing a section of string by a new string Hide the details

<Result> = Replace(<Initial String> , <Position> , <Length> , <New String>)
<Result>: Character string
New character string into which the replacement was performed.
<Initial String>: Character string (with quotes)
Character string where the replacement will be performed (maximum size: 2 GB).
<Position>: Integer
Position of the section of string to replace.
<Length>: Integer
Length of the string section to replace.
<New String>: Character string (with quotes)
Character string that will replace the specified string section.
WINDEVWEBDEV - Server codeiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App

Replacing a section of string by a new string Hide the details

<Result> = Replace(<Initial String> , <Position> , <Length> , <New String>)
<Result>: Character string
New character string into which the replacement was performed.
<Initial String>: Character string (with quotes)
Character string where the replacement will be performed (maximum size: 2 GB).
<Position>: Integer
Position of the section of string to replace.
<Length>: Integer
Length of the string section to replace.
<New String>: Character string (with quotes)
Character string that will replace the specified string section.
Remarks

Replace function and UNICODE

<Initial String>, <String to Replace> and <New String> can correspond to:
  • ANSI strings.
  • UNICODE strings.
  • buffers.
You have the ability to use ANSI strings, Unicode strings and buffers in the different parameters of the function.
The following conversion rule is used for the Ansi systems (Windows or Linux):
  • It at least one of the strings is a buffer, all the strings are converted into buffers and the operation is performed with buffers,
  • otherwise, if at least one of the strings is in Unicode format, all the strings are converted into Unicode and the operation is performed in Unicode,
  • otherwise, the operation is performed in Ansi format.
The following conversion rule is used for the Unicode systems (Windows CE):
  • It at least one of the strings is a buffer, all the strings are converted into buffers and the operation is performed with buffers,
  • otherwise, the operation is performed in Unicode.
Note: If the result on an ANSI string is assigned to a UNICODE string (and conversely), the conversion will be implicitly performed.
See Managing the UNICODE format for more details.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
WEBDEV - Browser code WDJS.DLL
Java wd230java.jar
Linux wd230vm.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
retirar qrcode
s_qrcode_xml is string=[
<![CDATA[http://hnfe.sefaz.ba.gov.br/servicos/nfce/modulos/geral/NFCEC_consulta_chave_acesso.aspx?]]>
]
s_qrcode_xml=Replace(s_qrcode_xml,"<![CDATA[","")
s_qrcode_xml=Replace(s_qrcode_xml,"]]>","")
EDT_resultado=s_qrcode_xml

// BLOG COM VIDEO E EXEMPLO

http://windevdesenvolvimento.blogspot.com.br/2017/09/aula-1254-xml-014-retirar-qrcode_3.html

https://www.youtube.com/watch?v=lYTEg4sdZa0

De matos
Sep. 03 2017