findunquoted.m
来自「JLAB is a set of Matlab functions I have」· M 代码 · 共 22 行
M
22 行
function[index]=findunquoted(s1,s2)%FINDUNQUOTED Finds unquoted instances of one string inside another%% FINDUNQUOTED(A,B) where A and B are strings, finds unquoted% instances of A inside B, and returns and an array specifiying % the position within B of the first letter of each occurrence.%% For example% findunquoted('apple',['banana apple ''apple'' apple'])% returns [8 22]. % _________________________________________________________________% This is part of JLAB --- type 'help jlab' for more information % (C) 2002, 2004 J.M. Lilly --- type 'help jlab_license' for details %findunquoted('==',['plot(1:100);x==10;title([''Tests whether x==10''])']) index=findstr(s1,s2);bool=isquoted(s1,s2);if ~isempty(find(bool)) index=index(find(~bool));end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?