bugfix, inBrackets actually works
This commit is contained in:
@@ -47,6 +47,9 @@ fun -string !mid -string &str -int &idx -int &len
|
||||
set &ans ""
|
||||
lesser $idx 0 &store
|
||||
if $store %end
|
||||
greater $len 0 &store
|
||||
if $store %loop
|
||||
return ""
|
||||
@loop
|
||||
getstrsize $str &store
|
||||
equal $store $idx &store
|
||||
@@ -66,11 +69,26 @@ fun -string !mid -string &str -int &idx -int &len
|
||||
endfun
|
||||
|
||||
fun -string !inBrackets -string &str -char &left -char &right -int &instance
|
||||
# Get start idx
|
||||
# Get left idx
|
||||
pusharg $str
|
||||
pusharg $left
|
||||
pusharg $instance
|
||||
call !findCharInstance &store
|
||||
call !findCharInstance &left
|
||||
|
||||
# Get right idx
|
||||
pusharg $str
|
||||
pusharg $right
|
||||
pusharg $instance
|
||||
call !findCharInstance &right
|
||||
|
||||
# Get inner string
|
||||
add $left 1 &left
|
||||
subtract $right $left &store
|
||||
pusharg $str
|
||||
pusharg $left
|
||||
pusharg $store
|
||||
call !mid &store
|
||||
return $store
|
||||
endfun
|
||||
|
||||
fun -bool !matchStart -string &str -string &instr
|
||||
|
Reference in New Issue
Block a user