PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • 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.
Remark: The initial character string is not modified.
InitialString is string = "Abracadabra!"
ReplacedString is string = Replace(InitialString, "a", "o")
Info(ReplacedString) // Displays "Abrococobro!"
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.
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):
  • If 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):
  • If 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.
Remark: 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.
Component : wd250vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
video windev replace
https://youtu.be/m1cKtL-KeoU
amarildo
03 Dec. 2018
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
03 Sep. 2017