It is currently April 25th, 2024, 4:35 pm

New String Case options?

Report bugs with the Rainmeter application and suggest features.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New String Case options?

Post by jsmorley »

And it should be noted that if you DO want to just impact the entire string, InlineSetting is still just one option, just as quick and easy as StringCase.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]

[MeterString]
Meter=String
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=i'm upper case
InlineSetting=Case | Upper


1.png


For me, and this is just for me... StringCase is really just deprecated.
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16169
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: New String Case options?

Post by balala »

jsmorley wrote: December 7th, 2019, 7:13 pm For me, and this is just for me... StringCase is really just deprecated.
As said, good point. Indeed. :thumbup:
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: New String Case options?

Post by Yamajac »

jsmorley wrote: December 7th, 2019, 7:13 pm And it should be noted that if you DO want to just impact the entire string, InlineSetting is still just one option, just as quick and easy as StringCase.

For me, and this is just for me... StringCase is really just deprecated.


Image

You can also do alternating case with InlineSettings in a similar fashion.

Code: Select all

InlinePattern = "."
InlineSetting = Case | Lower
InlinePattern2 = "(?s).(.)(?=(.{2})+$)"
InlineSetting2 = Case | Upper
To switch it around, just switch the InlineSettings so the first one changes them to Upper and the second one changes them to Lower instead.

You can play with the red bits below to change how many in a row get captured/skipped. You can add more periods, remove the period entirely, add more to the {2}, whatever. Causes different patterns. If you remove the period and leave it at {2} then it won't capture any though. {1} will also not capture any, and {0} will capture the entire string. Adding more though to either side typically causes different patterns.

InlinePattern2 = "(?s).(.)(?=(.{2})+$)"


Randomcase would probably not be reasonably possible in a single update cycle though, so that might be nice to have.