Tip: Creating ProperCase strings

Share your advanced PureBasic knowledge/code with the community.
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: Tip: Creating ProperCase strings

Post by Tenaja »

CharUpper_ and CharLower_ are windows api calls.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Tip: Creating ProperCase strings

Post by wilbert »

Just because someone might be able to use it ...
On OSX you can also use the OS to do this

Code: Select all

Procedure.s ProperCase(text.s)
  ProcedureReturn PeekS(CocoaMessage(0, CocoaMessage(0, CocoaMessage(0, 0, "NSString stringWithString:$", @text), "capitalizedString"), "UTF8String"), -1, #PB_UTF8)
EndProcedure

Debug ProperCase("this is a TEST StRiNG")
Windows (x64)
Raspberry Pi OS (Arm64)
User avatar
Frarth
Enthusiast
Enthusiast
Posts: 241
Joined: Tue Jul 21, 2009 11:11 am
Location: On the planet
Contact:

Re: Tip: Creating ProperCase strings

Post by Frarth »

Tenaja wrote:CharUpper_ and CharLower_ are windows api calls.
Yes I know but my question was, do they behave differently.
PureBasic 5.41 LTS | Xubuntu 16.04 (x32) | Windows 7 (x64)
Post Reply