Functions | |
elseif (nargin< 3) direction | |
if (l_s==0||l_s< l_t) v | |
elseif (l_t==0) v | |
if (strcmp(direction,"last")) v | |
endif | if (l_t > 3) if(all(size(s)! |
endif endif | if (n==0 &&!isempty(v)) n |
endif endfunction | !assert (index("astringbstringcstring","s"), 2)%!assert(index("astringbstringcstring" |
endif endfunction | !assert (index("astringbstringcstring","str"), 2)%!assert(index("astringbstringcstring" |
endif endfunction | !assert (index("abc---","abc+++"), 0)%!assert(index("astringbstringcstring" |
endif endfunction | !assert (index("astringbstringcstring","st","last"), 16)%!assert(index("astringbstringcstring" |
endif endfunction | !assert (index("astringbstringcstring","string","last"), 16)%!assert(index("abc---" |
!error | index ("foo","bar", 3) |
Variables | |
function | n |
endif | direction = lower (direction) |
if(!(ischar(s)&&ischar(t))) error("index endif | l_s = length (s) |
l_t = length (t) | |
else | limit = l_s - l_t + 1 |
v | |
endif | ind = 0:l_t-1 |
for | idx |
break | |
endif endfunction | st |
endif endfunction | string |
endif endfunction | s |
endif endfunction | last |
endif endfunction | str |
endif endfunction !assert | ( | index("astringbstringcstring","string","last") | , | |
16 | ||||
) |
endif endfunction !assert | ( | index("astringbstringcstring","st","last") | , | |
16 | ||||
) |
endif endfunction !assert | ( | index("abc---","abc+++") | , | |
0 | ||||
) |
endif endfunction !assert | ( | index("astringbstringcstring","str") | , | |
2 | ||||
) |
endif endfunction !assert | ( | index("astringbstringcstring","s") | , | |
2 | ||||
) |
elseif | ( | l_t | = =0 |
) |
elseif | ( | ) |
if | ( | strcmp(direction,"last") | ) |
if | ( | ) |
!error index | ( | "foo" | , | |
"bar" | , | |||
3 | ||||
) |
break |
l_t = length (t) |
endif endfunction str |