Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
|
|
@ -0,0 +1,47 @@
|
|||
include "NSLog.incl"
|
||||
local fn snake_toCamel( s as CFStringRef ) as CFStringRef
|
||||
long r,f
|
||||
s = fn StringByTrimmingCharactersInSet( s, fn CFCharacterSetGetPredefined(_kCFCharacterSetWhitespace ))
|
||||
for r = 1 to len(s)-2
|
||||
f = instr(0, @"_- ", mid(s, r, 1))
|
||||
if f <> NSNotFound
|
||||
s = fn stringwithformat(@"%@%@%@", left( s, r ), ucase(mid(s,r+1,1)), mid(s,r+2))
|
||||
end if
|
||||
next
|
||||
end fn = s
|
||||
|
||||
local fn CamelTo_snake( s as CFStringRef ) as CFStringRef
|
||||
long r,f
|
||||
s = fn StringByTrimmingCharactersInSet( s, fn CFCharacterSetGetPredefined(_kCFCharacterSetWhitespace ))
|
||||
s = fn StringByReplacingOccurrencesOfString( s, @" ", @"_")
|
||||
s = fn StringByReplacingOccurrencesOfString( s, @"-", @"_")
|
||||
for r = 1 to len(s)-2
|
||||
f = instr(0, @"ABCDEFGHIJKLMNOPQRSTUVWXYZ", mid(s, r, 1))
|
||||
if f <> NSNotFound
|
||||
if fn StringIsEqual(@"_", mid(s, r-1, 1)) then continue
|
||||
s = fn stringwithformat(@"%@%@%@", left( s, r ), @"_", mid(s,r))
|
||||
end if
|
||||
next
|
||||
s = fn stringwithformat(@"%@%@",left( s, 1), lcase(mid(s, 1)))
|
||||
end fn = s
|
||||
|
||||
local fn show( s1 as CFStringRef )
|
||||
CFStringRef s = @" "
|
||||
CFStringRef s2 = fn snake_toCamel( s1 )
|
||||
CFStringRef s3 = fn CamelTo_snake( s1 )
|
||||
nslog(@" \"%@\"%@\"%@\"%@\"%@\"", s1, mid(s, len(s1)), s2, mid(s, len(s2)), s3)
|
||||
end fn
|
||||
|
||||
nslog( @"%@",@"String ¬
|
||||
fn snake_toCamel ¬
|
||||
fn CamelTo_snake")
|
||||
fn show(@"snakeCase")
|
||||
fn show(@"snake_case")
|
||||
fn show(@"variable_10_case")
|
||||
fn show(@"variable10Case")
|
||||
fn show(@"ɛrgo rE tHis")
|
||||
fn show(@"hurry-up-joe!")
|
||||
fn show(@"c://my-docs/happy_Flag-Day/12.doc")
|
||||
fn show(@" spaces ")
|
||||
|
||||
handleevents
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
String fn snake_toCamel fn CamelTo_snake
|
||||
"snakeCase" "snakeCase" "snake_case"
|
||||
"snake_case" "snakeCase" "snake_case"
|
||||
"variable_10_case" "variable10Case" "variable_10_case"
|
||||
"variable10Case" "variable10Case" "variable10_case"
|
||||
"ɛrgo rE tHis" "ɛrgoRETHis" "ɛrgo_r_e_t_his"
|
||||
"hurry-up-joe!" "hurryUpJoe!" "hurry_up_joe!"
|
||||
" spaces " "spaces" "spaces"
|
||||
"c://my-docs/happy_Flag-Day/12.doc" "c://myDocs/happyFlagDay/12.doc" "c://my_docs/happy_flag_day/12.doc"
|
||||
Loading…
Add table
Add a link
Reference in a new issue