How to use regex with ToUppercase function ?
Hi, how to use regex with ToUppercase function ?
for exemple, i'm trying to set the first letter of a variable into Uppercase, the only way i found is this one :
SET VAR "variable" "test" #select_first_letter FUNCTION Substring "0" "1" "<variable>" -> VAR "TEST1" #set_first_letter_uppercase FUNCTION ToUppercase "<TEST1>" -> VAR "TEST2" #delete_first_letter FUNCTION Replace "^[a-zA-Z]" "" UseRegex=TRUE "<variable>" -> VAR "variable2" #fix_output FUNCTION Constant "<TEST2><variable2>" -> VAR "final"
Hi, I think this is the only way, the replace function does not support things like
@Ruri ok, thanks ! I have another question, is it possible to use regex with Lolisricpt ?
for exemple :
IF "test" Contains "[0-9]" ##some stuff ENDIF
I think there is something like MatchesRegex, look at the keycheck block to see the available options, you can use all of those in the IF statement
@Ruri ok, thank you !
luciole last edited by luciole
my last question is how to count the number of strings of a list ? Thanks again for your answer and your time !
Utility block, List group, Length
@Ruri Thanks !