Stata 11 help for mf_strtrim

help mata strtrim() -------------------------------------------------------------------------------

Title

[M-5] strtrim() -- Remove blanks

Syntax

string matrix stritrim(string matrix s)

string matrix strltrim(string matrix s)

string matrix strrtrim(string matrix s)

string matrix strtrim(string matrix s)

Description

stritrim(s) returns s with all consecutive, internal blanks collapsed to one blank.

strltrim(s) returns s with leading blanks removed.

strrtrim(s) returns s with trailing blanks removed.

strtrim(s) returns s with leading and trailing blanks removed.

When s is not a scalar, these functions return element-by-element results.

Remarks

Stata understands stritrim(), strltrim(), strrtrim(), and strtrim(), as synonyms for its own itrim(), ltrim(), rtrim(), and trim() functions, so you can use the str*() names in both your Stata and Mata code.

Conformability

stritrim(s), strltrim(s), strrtrim(s), strtrim(s): s: r x c result: r x c

Diagnostics

None.

Source code

Functions are built in.

Also see

Manual: [M-5] strtrim()

Help: [M-4] string


© Copyright 1996–2009 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index