Simplicty and flexibility!


Function::String

FirstW
FirstW(TEXT VALUE,n)
FirstW("My Text String. My Second Text String.",3)
FirstW(MyTextField,MyWordCount)
FirstW(Concat(Firstname,Lastname),2)


The firstw function extracts a specified number of words from the beginning (left) of a text value.

firstw(FIELDNAME, n) returns the first n words in the field, including intervening punctuation symbols. Leading spaces are treated as delimiters. Trailing spaces are ignored. If there are n or fewer words in the field, firstw returns the original text value.

Parameters


TEXT VALUE

Any text string.

n

Numer of words that you want the function to return from the beginning of TEXT VALUE.

Returns/Result


A text value n words in length.

Examples


Examples


firstw( "4 The People Limited." , 2)

Returns: 4 The,


firstw( "Club ParaDEASE" , 1)

Returns: Club


firstw( ADDRESS , 2)

Returns:The first two words in the ADDRESS field for every record that is processed. If a record contains the value 540 Avenida de los Delfines in the ADDRESS field, the function returns 540 Avenida.


Reference

firstw

Type

Text Function

Purpose

The firstw function extracts a specified number of words from the beginning (left) of a text value.

Syntax

firstw( TEXT VALUE, n)

Returns

A text value n words in length.

Usage

firstw(FIELDNAME, n) returns the first n words in the field, including intervening punctuation symbols. Leading spaces are treated as delimiters. Trailing spaces are ignored. If there are n or fewer words in the field, firstw returns the original text value.

Examples

firstw( "Sapphire International Ltd." , 2)

Returns: Sapphire International,

 

firstw( "Club ParaDEASE" , 1)

Returns: Club

 

firstw( ADDRESS , 2)

Returns:The first two words in the ADDRESS field for every record that is processed. If a record contains the value 540 Avenida de los Delfines in the ADDRESS field, the function returns 540 Avenida.

See Also


FirstLast
LastFirst
MidW
LastW

On the forum about FirstW

On the blog about FirstW


dg3_HelpView