14.03.2014 Views

Download Jmp User Guide

Download Jmp User Guide

Download Jmp User Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix C Formula Functions Reference 461<br />

Character Functions<br />

Find/Length is a character or numeric expression. Use a character string as search criterion, or use a<br />

positive integer to return that number of consecutive characters starting from the Offset position. If<br />

you specify a negative integer as the Length value, Munger returns all characters from the Offset<br />

through to the end of the string.<br />

Replace (optional argument) can be a string or unspecified. If it is a string and the Find/Offset value is<br />

numeric, Munger replaces the search criterion with the Replace string to form the result. If the Find/<br />

Offset value is numeric and no string is specified, Munger calculates a substring. If the Find/Length<br />

value is a character string, Munger always returns the numeric offset, disregarding the Replace value if<br />

it exists. To insert the Replace argument, click any argument in the Munger function and then click<br />

the insert button. Use the delete key on your keyboard or the delete button ( ) on the formula editor<br />

keypad to remove the Replace argument.<br />

Lowercase, Uppercase<br />

The Lowercase function converts any uppercase character found in its argument to the equivalent<br />

lowercase character. For example, Lowercase("VERONICA LAYMAN") evaluates as veronica layman. The<br />

Uppercase function converts any lowercase character found in its argument to the equivalent<br />

uppercase character. For example, Uppercase("Veronica Layman") evaluates as VERONICA<br />

LAYMAN.<br />

Length<br />

Calculates the length of its argument. For example, Length("Veronica") evaluates as 8. If the argument is<br />

• a string, length returns the number of characters;<br />

• a list, length returns the number of items in the list;<br />

• a blob (binary object), the number of bytes.<br />

Num<br />

Produces a numeric value that corresponds to its character string argument when the character string<br />

consists of numbers only. If a character string contains a non-numeric value, the result is a missing<br />

value. For example, Num(“1.123”) evaluates as 1.123.<br />

C Formula Functions Reference<br />

Substr<br />

Extracts the characters that are the portion of the first argument beginning at the position given by the<br />

second argument and ending based on the number of characters specified in the third argument. The<br />

first argument can be either a character column or a literal value. The starting argument and the length<br />

argument can be numbers of expressions that evaluate to numbers. For example, to show the first name<br />

only, Substr("Veronica Layman", 10, 6) starts at position 11 and reads through position 16, which yields<br />

Layman.<br />

If start is negative, Substr searches backward from start from the end of the string. If length is negative<br />

or absent, Substr returns a string that begins with start and continues to the end of s.<br />

Substr can also be used with lists.<br />

Trim<br />

Produces a new character string from its argument, removing any trailing blanks. For example,<br />

Trim("john ") evaluates as john.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!