0% found this document useful (0 votes)
3 views10 pages

String Function

The document outlines various string functions, including Capitalize, Chr, Evaluate, KeepChar, Left, Len, Lower, Upper, Mid, Ord, Repeat, Replace, Right, SubField, SubStringCount, Trim, LTrim, and RTrim. Each function is described with its purpose and syntax for usage. These functions are designed to manipulate and evaluate strings in different ways, such as changing case, trimming spaces, and counting substrings.

Uploaded by

Navya shree R
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views10 pages

String Function

The document outlines various string functions, including Capitalize, Chr, Evaluate, KeepChar, Left, Len, Lower, Upper, Mid, Ord, Repeat, Replace, Right, SubField, SubStringCount, Trim, LTrim, and RTrim. Each function is described with its purpose and syntax for usage. These functions are designed to manipulate and evaluate strings in different ways, such as changing case, trimming spaces, and counting substrings.

Uploaded by

Navya shree R
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

String Function

Capitalize
The capitalize function returns a string with each word of the string starting with a
capital letter.
Syntax: Capitalize(text)
Chr
The chr function returns the Unicode character corresponding to the integer you
have entered in the expression.
Syntax:Chr(int)

Evaluate
This function checks an input value in the expression for whether it can be
evaluated in some or not. If it involves the evaluation of some kind then this
function returns the value after evaluation. It returns the values in dual data
format. If there is no evaluation in the expression then NULL is returned.
Syntax: Evaluate(expression_text)
KeepChar
The KeepChar function returns a string which keeps only a particular section or
some characters of the entire string. Which is why, the name of this function is
‘keepchar’ which indicates keeping a character.
Syntax:KeepChar(text, keep_chars)

Left
The left function returns a set of characters from the left of the string. Number of
characters which you want the function to return can also be mentioned in the
expression.
Syntax:Left(text, count)
Len
This function returns the length of the input string, i.e. the total number of
characters used in a string.
Syntax:Len(text)

Lower
This function returns a string which is converted fully into a string having
characters in lowercase.
Syntax:Lower(text)

Upper
Just as opposite to the lower() function, this function coverts all the characters in
the string into uppercase or capital letters.
Syntax:Upper(text)
Mid
This function takes in three arguments, i.e. a text input, a start and a count. These
parameters decide the length of characters from the given text input which
should be returned as resultant string. The characters in the string are numbered
from 1 to n (for n number of characters in the string).
Syntax:Mid(text, start[, count])
Ord
This function returns the Unicode codepoint number for the first character of the
string you input.
syntax:Ord(text)

Repeat
The repeat function repeats a character or all the characters in the string as many
times as mentioned in the second argument of the function.
Syntax:repeat(text[, repeat_count])
Replace
This function replaces a set of characters in the string with other characters. This
function reads the string from left to right and returns a value of string data type.
syntax:replace(text, from_str, to_str)

Right
This function returns the characters from the right most corner of the string. You
can also specify the number of characters that you want to include from the right.
Syntax :right(text, count)
SubField
We use the SubField function to create a new field using the data from old or
already existing fields. Thus, the new field created is called the subfield. A subfield
is said to have parts of the original field. Like a ‘City’ subfield from an original field
‘Address’, will keep all the cities in one field.
Syntax :SubField(text, delimiter[, field_no ])
SubStringCount
This function counts how many times a substring i.e. a part of the original string is
occurring the original or parent string. This function returns the answer as an
integer value.
Syntax:SubStringCount(text, sub_string)

Trim
The trim function trims a string for both leading (from left) and trailing (from
right) spaces.
Syntax:Trim(text)
For example,
• Trim(‘ xyz’) trims the leading space and returns ‘xyz’.
• Trim(‘xyz ‘) trims the trailing space and returns ‘xyz’.
• Trim(‘ xyz ‘) trims both the leading and trailing spaces and returns ‘xyz’.

LTrim
This function trims the string of any leading paces between the characters or at
the start or from the left of the string.
Syntax:LTrim(text)
For example,
• LTrim( ‘ DataFlair’ )will return a trimmed string as, ‘DataFlair’.
• LTrim( ‘DataFlair ‘ )returns a string trimmed of spaces as ‘DataFlair’
RTrim
The RTrim() function will trim a string entered in the script for any trailing spaces
i.e. from the right of the string.
Syntax:RTrim(text)
Where, text is the original string which you want to trim of any unwanted spaces.
For example,
RTrim( ‘Hello ‘ ) will return a trimmed string from the right, ‘Hello’

You might also like