User:anonymousLog inRegister
Recents:
Concat Function

Scope

Objects: Procedures, Transactions, Web PanelsWork Panels
Languages: .NET, Ruby, Java, RPG, Visual FoxPro, Cobol

Purpose

To concatenate two strings including a separator if desired.

Syntax

Concat(character-expression1, character-expression2, [ ,character-expression3 ] )

Type Returned:
Character

Where:
character-expression3
Is the separator between character-expression1 and character-expression2

Description

Returns a String that results from the concatenation of character-expression1 and character-expression2 and separator character-expression3. Trailing blanks of string character-expression1 are truncated. If character-expression3 is not specified, no separator is inserted.

Note:
In the iSeries, if the strings character-expression1, character-expression2 or character-expression3 are substituted with functions (substr(), str(), etc), then the returned value is null, because the returned values of these functions are 256-character-long variables.

Examples

LastName  = 'SMITH '
FirstName = 'JOHN '
FullName = Concat(FirstName,LastName,' ')

Result: FullName = 'JOHN SMITH '

In case you want to maintain the trailing blanks in the first parameter, you may change the order of the parameters. For example:
 

LastName  = 'SMITH'
FirstName = 'JOHN '
FullName = Concat(,LastName,FirstName)
Result: FullName = 'JOHN SMITH'

See Also

Str Function
Substr Function

Created: 07/22/08 10:25 AM by dmarquez Last update: 08/02/10 05:30 PM by blima ginzo
 
Page
Categories
Group
 
Powered by GXwiki 3.0 (generated with GeneXus X Evolution 1 U3)