ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / String functions
  • Conversion rules
  • Miscellaneous
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Converts all characters in a string to uppercase according to the region settings defined in Windows.
Remark: Upper is kept for backward compatibility and can only be used with Latin character sets. To configure the formatting of a string more precisely or to handle other character sets, use StringFormat.
Example
Upper("abcd")   // Returns "ABCD"
Upper("élan")  // Returns "ELAN"
Upper("this!")   // Returns "THIS!"
Syntax
<Result> = Upper(<String to convert>)
<Result>: Character string
String in uppercase characters.
<String to convert>: Character string
String to convert to uppercase.
Remarks

Conversion rules

  • Unaccented lowercase characters are converted to unaccented uppercase characters.
  • Accented lowercase characters are converted to unaccented uppercase characters.
    WEBDEV - Browser code Accented lowercase characters are converted to accented uppercase characters.
  • Unaccented uppercase characters remain unchanged.
  • Accented uppercase characters remain unchanged.
Remark: Upper is kept for backward compatibility and can only be used with Latin character sets. To configure the formatting of a string more precisely or to handle other character sets, use StringFormat.

Miscellaneous

  • "Whitespaces" are kept.
  • The HFSQL engine automatically performs case-insensitive searches. Therefore, Upper has no effect when performing this type of operation.
Component: wd290vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Função Capitalize
Procedure Capitalize(LOCAL Texto)

ChangeCharset(charsetOccidental) // SEM ACENTO

IF Texto <> Null AND Texto <> ""
Texto = NoAccent(Texto)

Texto = Lower(Texto)

Texto = Upper(Middle(Texto,1,1)) + Middle(Texto,2,Length(Texto))

nEspaco01 is int = PositionOccurrence(Texto," ",firstRank,FromBeginning) + 1
IF nEspaco01 > 1 THEN
Texto = Middle(Texto,1,nEspaco01-1) + Upper(Middle(Texto,nEspaco01,1)) + Middle(Texto,nEspaco01+1,Length(Texto))
END


TOT is int = 0
POS1, POS2, POS3 is int = 0
TOT = Length(Texto)
LOOP (TOT)
POS1 +=1
POS2 = POS1 + 1
POS3 = POS2 + 1
IF Middle(Texto,POS1,1) = " " AND Middle(Texto,POS2,1) <> " "
Texto = Middle(Texto,1,POS1) + Upper(Middle(Texto,POS2,1)) + Middle(Texto,POS3,TOT)
END
END


Texto = Replace(Texto," Da ", " da ")

Texto = Replace(Texto," Das ", " das ")

Texto = Replace(Texto," De ", " de ")

Texto = Replace(Texto," Do ", " do ")

Texto = Replace(Texto," Dos ", " dos ")

END

RESULT(Texto)
BOLLER
23 Feb. 2019

Last update: 05/26/2022

Send a report | Local help