fix struppercase and strlowecase

This commit is contained in:
Daniella / Tove 2022-03-06 20:07:48 +01:00
parent e28ad23a7f
commit 3de2acc941
2 changed files with 12 additions and 11 deletions

View file

@ -13,9 +13,10 @@ func main {
id STREAM_CLOSE stream
"testing\n" puts
"Testing: \n" struppercase puts
"helloworld.isbpl" include
main pop
"TEST DONE\n" strlowercase puts
0
}

View file

@ -361,27 +361,27 @@ func random {
}
func strlowercase {
def s =s "bind string" #
def s _array =s "bind string" #
def i 0 =i
while { i s alen lt } {
def char s i aget =char
char 64 gt char 91 lt and if {
s i char 32 + aput
def chr s i aget =chr
chr "A" char lt not chr "Z" char gt not and if {
s i chr "a" char "A" char - + aput
}
i inc
}
s
s _string
}
func struppercase {
def s =s "bind string" #
def s _array =s "bind string" #
def i 0 =i
while { i s alen lt } {
def char s i aget =char
char 89 gt char 123 lt and if {
s i char 32 - aput
def chr s i aget =chr
chr "a" char lt not chr "z" char gt not and if {
s i chr "a" char "A" char - - aput
}
i inc
}
s
s _string
}