El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

String Functions

Updated on 2022-07-04 GMT+08:00

Table 1 lists the string functions supported by DLI.

Table 1 String functions

Function

Return Type

Description

ascii(string str)

INT

Returns the numeric value of the first character in a string.

concat(string A, string B...)

STRING

Return a string resulting from concatenating the input strings. This function can take any number of input strings.

concat_ws(string SEP, string A, string B...)

STRING

Return a string resulting from concatenating the input strings, which are separated by specified separators.

encode(string src, string charset)

BINARY

Encode src in the encoding mode specified by charset.

find_in_set(string str, string strList)

INT

Return the position of the first occurrence of str in strList. If the value of any parameter is NULL, NULL is returned. If the first parameter contains a comma (,), 0 is returned.

get_json_object(string json_string, string path)

STRING

Parse the JSON object in a specified JSON path. The function will return NULL if the JSON object is invalid.

instr(string str, string substr)

INT

Return the position of the first occurrence of substr in str. Return NULL if NULL is contained in the parameters and return 0 if substr does not exist in str. Note that the subscripts start from 1.

length(string A)

INT

Return the length of a string.

locate(string substr, string str[, int pos])

INT

Return the position of the first occurrence of substr in str after position pos (starting from 1).

lower(string A) lcase(string A)

STRING

Convert all characters of a string to lower case.

lpad(string str, int len, string pad)

STRING

Return a string of a specified length. If the length of the given string (str) is shorter than the specified length (len), the given string is left-padded with pad to the specified length.

ltrim(string A)

STRING

Trim spaces from the left hand side of a string.

parse_url(string urlString, string partToExtract [, string keyToExtract])

STRING

Return the specified part of the specified URL. Valid values of partToExtract include HOST, PATH, QUERY, REF, PROTOCOL, AUTHORITY, FILE, and USERINFO.

For example, parse_url ('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1 ',' HOST ') returns 'facebook.com'.

When the second parameter is QUERY, the third parameter can be used to extract the value of a specific parameter. For example, parse_url('http://facebook.com/path1/p.php?k1=v1&k2=v2#Ref1', 'QUERY', 'k1') returns 'v1'.

printf(String format, Obj... args)

STRING

Print the input according to a specified format.

regexp_extract(string subject, string pattern, int index)

STRING

Extract the string specified by the regular expression. regexp_extract ('foothebar ',' foo (.*?) (bar) '2) returns 'bar.'

regexp_replace(string A, string B, string C)

STRING

Replace character B in string A with character C.

repeat(string str, int n)

STRING

Repeat a string N times.

reverse(string A)

STRING

Return the reversed string.

rpad(string str, int len, string pad)

STRING

Return a string of a specified length. If the length of the given string (str) is shorter than the specified length (len), the given string is right-padded with pad to the specified length.

rtrim(string A)

STRING

Trim spaces from the right hand side of a string.

space(int n)

STRING

Returns a specified number of spaces.

substr(string A, int start) substring(string A, int start)

STRING

Return the substring starting from the specified start position in string A till the end of the string.

substr(string A, int start, int len) substring(string A, int start, int len)

STRING

Return the substring of a specified length starting from the specified start position in A string.

substring_index(string A, string delim, int count)

STRING

Return the substring from string A before count occurrences of the delimiter delim.

translate(string|char|varchar input, string|char|varchar from, string|char|varchar to)

STRING

Translate the input string by replacing the characters or string specified by from with the characters or string specified by to. For example, replace bcd in abcde with BCD using translate ("abcde", "bcd", "BCD").

trim(string A)

STRING

Trim spaces from both ends of a string.

upper(string A) ucase(string A)

STRING

Convert all characters of a string to upper case.

initcap(string A)

STRING

Convert the first letter of each word of a string to upper case and all other letters to lower case.

levenshtein(string A, string B)

INT

Return the Levenshtein distance between two strings. Example: levenshtein ('kitten ',' sitting ') = 3.

soundex(string A)

STRING

Return the soundex string from str. Example: soundex ('Miller ') = M460.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback