# 22. Virtuoso Functions Guide - string

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY
and
append
assign
avg
boolean
ceiling
concat
contains
count
create-attribute
create-comment
create-element
create-pi
current
distinct
doc
document
document-literal
empty
ends-with
every
except
false
filter
floor
fn:collection
for
format-number
function-available
generate-id
id
if
intersect
is_after()
is_before()
key
lang
last
let
list()
local-name
max
min
name
namespace-uri
normalize-space
not
number
or
position
processxquery
processxslt
processxsql
progn()
replace()
round
serialize
shallow
some
starts-with
string
string-length
substring
substring-after
substring-before
sum
system-property
text_contains()
translate
true
tuple()
union
unordered
unparsed-entity-uri
urlify
xmlview
Functions Index

## string

Returns a string value of its argument.
string string ([obj any]);
Description

The string() function converts an object to a string as follows:

- An empty sequence is converted to an empty string.

- A nonempty node-set is converted to a string by returning the string-value of the first node in the node-set. Note that the XPATH standard says that 'first' means 'first in document order' here, not 'first value returned'. For almost all queries, there is no difference between these two orders; it may be important only for node-sets calculated by so-called reverse-order axis. Moreover, the rure of standard is senseless if node-set contains nodes from more than one document. That is why the standard is violated here, intentionally.

- A nonempty sequence which is not a node-set is converted to a string by returning the string-value of the first node in the sequence.

- A NaN number is converted to the string 'NaN'.

- Zero is converted to the string '0'.

- Positive infinity is converted to the string 'Infinity'

- Negative infinity is converted to the string '-Infinity'

- Integer number is represented in decimal form with no decimal point and no leading zeros, preceded by a minus sign '-' if the number is negative.

- Non-integer number is represented in decimal form including a decimal point with at least one digit before the decimal point and at least one digit after the decimal point, preceded by a minus sign '-' if the number is negative; there must be no leading zeros before the decimal point apart possibly from the one required digit immediately before the decimal point; beyond the one required digit after the decimal point there will be be as many, but only as many, more digits as are needed to uniquely distinguish the number from all other IEEE 754 numeric values.

- The boolean false value is converted to the string 'false'. The boolean 'true' value is converted to the string 'true'.

- An object of a type other than the listed above is converted to a string in a way that is dependent on that type.

If the argument is omitted, context node is converted instead as if it is a node-set of one element.

Parameters
obj – Value to be converted into the string
Return Types

String

Errors

SQLState | Error Code | Error Text | Description
--- | --- | --- | ---

Examples

    string(//title)

See Also

format_number()

serialize()

urlify()

concat()