UltipaDocs
Try Playground
  • Introduction
  • Terminologies
    • Graphset
    • Schema
    • Property
    • Constraints
    • Insert
    • Overwrite or Insert
    • Upsert
    • Update
    • Delete
    • Find Nodes
    • Find Edges
      • AB
      • Autonet
      • Spread
      • Path Template
      • K-Hop
      • K-Hop Template
    • GROUP BY
    • ORDER BY
    • SKIP
    • LIMIT
    • WHERE
    • RETURN
    • WITH
    • UNCOLLECT
    • UNION
    • UNION ALL
    • CALL
    • All Functions
    • Path Functions
    • Aggregate Functions
    • Mathematical Functions
    • Trigonometric Functions
    • String Functions
    • List Functions
    • Datetime Functions
    • Spatial Functions
    • Table Functions
    • Null Functions
    • Type Conversion Functions
  • Operators
  • Expressions
    • Index
    • Full-text Index
    • Vector Index
    • Cache
    • Overview
    • Managing HDC Graphs
    • HDC Graph Queries
    • Process
    • Job
    • Execution Plan
    • Alias
    • Filter
    • Values and Types
    • Data Flow in Queries
    • Comments
    • Reserved Words
  • Access Control
  1. Docs
  2. /
  3. UQL
  4. /
  5. Functions

String Functions

btrim()

Removes characters from both ends of a given string until encountering a character not included in the specified set of characters.

Syntaxbtrim(<str>[, <chars>])
ArgumentsNameTypeDescription
<str>TextualThe original string
<chars>STRINGThe set of characters to look for; it defaults to a space
Return TypeSTRING
UQL
return btrim("  Ultipa Graph   ") AS newString

Result:

newString
Ultipa Graph
UQL
return btrim("123ABC341", "123") AS newString

Result:

newString
ABC34

endsWith()

Checks whether a string ends with a specified substring, returning 1 for true and 0 for false.

SyntaxendsWith(<str>, <subStr>)
ArgumentsNameTypeDescription
<str>TextualThe input string
<subStr>STRINGThe substring to look for
Return TypeSTRING
UQL
return endsWith("ultipa.com", "com")

Result:

endsWith("ultipa.com", "com")
1

length()

Returns the number of characters in a string.

Syntaxlength(<str>)
ArgumentsNameTypeDescription
<str>TextualThe input string
Return TypeUINT
UQL
return length("Ultipa Graph")

Result:

length("Ultipa Graph")
12

lower()

Converts all the characters in a given string to lowercase.

Syntaxlower(<str>)
ArgumentsNameTypeDescription
<str>TextualThe original string
Return TypeSTRING
UQL
return lower("Ultipa Graph")

Result:

lower("Ultipa Graph")
ultipa graph

ltrim()

Removes characters from the begining of a given string until encountering a character that is not contained in the specified set of characters.

Syntaxltrim(<str>[, <chars>])
ArgumentsNameTypeDescription
<str>TextualThe original string
<chars>STRINGThe set of characters to look for; it defaults to a space
Return TypeSTRING
UQL
return ltrim("  Ultipa Graph   ") AS newString

Result:

newString
Ultipa Graph
UQL
return ltrim("124ABC341", "123") AS newString

Result:

newString
4ABC341

rtrim()

Removes characters from the end of a given string until encountering a character that is not contained in the specified set of characters.

Syntaxrtrim(<str>[, <chars>])
ArgumentsNameTypeDescription
<str>TextualThe original string
<chars>STRINGThe set of characters to look for; it defaults to a space
Return TypeSTRING
UQL
return rtrim("  Ultipa Graph   ") AS newString

Result:

newString
Ultipa Graph
UQL
return rtrim("123ABC4321", "123") AS newString

Result:

newString
123ABC4

split()

Splits a string into a list of substrings using the specified delimiter.

Syntaxsplit(<str>, <delimiter>)
ArgumentsNameTypeDescription
<str>TextualThe input string
<delimiter>STRINGThe delimiter
Return TypeLIST
UQL
return split("apple, pumpkin, lemon tart", ", ") as strList

Result:

strList
["apple","pumpkin","lemon tart"]

startsWith()

Checks whether a string begins with a specified substring and returns 1 for true or 0 for false.

SyntaxstartsWith(<str>, <subStr>)
ArgumentsNameTypeDescription
<str>TextualThe input string
<subStr>STRINGThe substring to look for
Return TypeSTRING
UQL
return startsWith("ultipa.com", "ultipa")

Result:

startsWith("ultipa.com", "ultipa")
1

upper()

Converts all the characters in a given string to uppercase.

Syntaxupper(<str>)
ArgumentsNameTypeDescription
<str>TextualThe original string
Return TypeSTRING
UQL
return upper("Ultipa Graph")

Result:

upper("Ultipa Graph")
ULTIPA GRAPH