?? mf_strmatch.hlp
字號:
{smcl}
{* 25mar2005}{...}
{cmd:help mata strmatch()}
{hline}
{* index strmatch()}{...}
{* index pattern matching}{...}
{* index string pattern matching}{...}
{title:Title}
{p 4 4 2}
{bf:[M-5] strmatch() -- Determine whether string matches pattern}
{title:Syntax}
{p 8 12 2}
{it:real matrix}
{cmd:strmatch(}{it:string matrix s}{cmd:,}
{it:string matrix pattern}{cmd:)}
{title:Description}
{p 4 4 2}
{cmd:strmatch(}{it:s}{cmd:,} {it:pattern}{cmd:)} returns 1 if {it:s} matches
{it:pattern} and 0 otherwise.
{p 4 4 2}
When arguments are not scalars, {cmd:strmatch()} returns element-by-element
results.
{title:Remarks}
{p 4 4 2}
In {it:pattern}, {cmd:*} means "0 or more characters go here" and
{cmd:?} means "exactly one character goes here".
Thus {it:pattern}="{cmd:*}" matches anything and
{it:pattern}="{cmd:?p*x}" matches all strings whose second character is
{it:p} and whose last character is {it:x}.
{p 4 4 2}
Stata understands {cmd:strmatch()} as a synonym for its own {cmd:match()}
function, so you can use the {cmd:strmatch()} function in both your Stata
and Mata code.
{title:Conformability}
{cmd:strmatch(}{it:s}{cmd:,} {it:pattern}{cmd:)}:
{it:s}: {it:r1 x c1}
{it:pattern}: {it:r2 x c2}, {it:s} and {it:pattern} r-conformable
{it:result}: max({it:r1},{it:r2}) {it:x} max({it:c1},{it:c2})
{title:Diagnostics}
{p 4 4 2}
In {cmd:strmatch(}{it:s}{cmd:,} {it:pattern}{cmd:)}, if {it:s} or {it:pattern}
contain a binary 0 (they usually would not), the strings are considered to end
at that point.
{title:Source code}
{p 4 4 2}
Function is built-in.
{title:Also see}
{p 4 13 2}
Manual: {hi:[M-5] strmatch()}
{p 4 13 2}
Online: help for
{bf:{help m4_string:[M-4] string}}
{p_end}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -