⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mf_strmatch.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 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}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -