SQL String Functions

Have you ever wondered how databases handle and manipulate vast amounts of text data? Is there a way to efficiently manage and transform text information within databases without breaking a sweat? Well, the answer lies in SQL String Functions.

SQL String Functions are powerful tools that allow you to perform various operations on text data within databases. From concatenating strings to extracting substrings, replacing values, and converting letter cases, these functions equip you with the capabilities to handle text manipulation efficiently.

In this comprehensive guide, we will take you on a journey through the world of SQL String Functions. We will explore the commonly used functions, understand their purpose, and learn how to apply them effectively. Whether you are a beginner or an experienced database user, this article will equip you with the knowledge to harness the true potential of SQL String Functions.

Key Takeaways:

  • SQL String Functions are essential for manipulating and managing text data in databases
  • Functions like CONCAT, SUBSTRING, REPLACE, UPPER/LOWER, and more offer versatile text manipulation capabilities
  • Using SQL String Functions, you can combine, extract, replace, and convert text values efficiently
  • The REGEXP functions provide advanced pattern matching capabilities for complex string manipulation tasks
  • The LENGTH and DATALENGTH functions help in determining the length of strings and binary data, respectively

What are SQL String Functions?

SQL String Functions are an essential part of SQL, allowing users to perform a variety of operations on text data within databases. These functions provide powerful tools for manipulating, extracting, and transforming strings, enabling users to efficiently work with textual information in their queries.

SQL String Functions are a set of built-in functions that can be used to perform various operations on text data, such as concatenation, substring extraction, replacing portions of strings, converting case, and much more. These functions play a crucial role in data manipulation and analysis, enabling users to parse and manipulate strings within SQL queries.

Whether you need to combine two or more strings, extract a specific portion of a string, convert text to uppercase or lowercase, or search for patterns within string values, SQL String Functions can simplify the process and streamline your database operations.

By utilizing SQL String Functions effectively, you can optimize your queries, improve data manipulation efficiency, and achieve your desired results with ease. These functions are designed to handle common string-related tasks, providing a standardized and efficient way to work with text data in databases.

Throughout this article, you will explore the most commonly used SQL String Functions, including CONCAT, SUBSTRING, REPLACE, UPPER/LOWER, and many others. Gain a comprehensive understanding of how these functions work, their syntax, and examples of real-world use cases.

Summary

  • SQL String Functions allow users to perform operations on text data in databases.
  • They provide powerful tools for manipulating, extracting, and transforming strings.
  • Common operations include concatenation, substring extraction, replacing portions of strings, and converting case.
  • By utilizing SQL String Functions effectively, users can optimize queries and improve data manipulation efficiency.

Commonly Used SQL String Functions

In this section, we will explore some of the most commonly used SQL String Functions that are essential for efficient manipulation and management of text data in databases. These functions provide powerful tools to handle various string operations, allowing users to extract, combine, replace, and convert text easily.

1. CONCAT

The CONCAT function in SQL is used to concatenate multiple string values into a single string. It is particularly useful when combining the values of different columns or adding additional text to a string. The CONCAT function takes two or more parameters and returns a new string comprising all the input values combined.

2. SUBSTRING

The SUBSTRING function enables users to extract a portion of a string based on specific criteria. It allows you to retrieve a substring from a given string by specifying the starting position and the number of characters you want to extract. This function is commonly used for tasks such as extracting a person’s name from a full name or retrieving the domain name from a URL.

3. REPLACE

The REPLACE function allows users to substitute a specific portion of a string with a new value. It is useful for modifying strings by replacing certain characters or sequences within them. The REPLACE function takes three parameters: the original string, the portion to be replaced, and the replacement value.

4. UPPER and LOWER

The UPPER and LOWER functions in SQL are used to convert text to uppercase and lowercase, respectively. These functions are helpful in standardizing text values or performing case-insensitive searches. The UPPER function converts all characters in a string to uppercase, while the LOWER function converts them to lowercase.

5. Other SQL String Functions

In addition to the functions mentioned above, there are several other SQL String Functions that are commonly used:

  • LENGTH: Calculates the length (number of characters) of a string.
  • TRIM: Removes leading and trailing spaces from a string.
  • LIKE: Allows searching for specific patterns within string values using wildcard characters.
  • REGEXP: Provides advanced pattern matching capabilities for string manipulation.
  • ASCII and CHAR: Work with character codes and convert them to corresponding characters.
  • CONCAT_WS: Concatenates multiple string values with a specified separator.

Here is a table summarizing these commonly used SQL String Functions and their functionalities:

Function Description
CONCAT Combines multiple string values into a single string.
SUBSTRING Extracts a portion of a string based on specific criteria.
REPLACE Substitutes a specific portion of a string with a new value.
UPPER/LOWER Converts text to uppercase or lowercase, respectively.
LENGTH Calculates the length of a string.
TRIM Removes leading and trailing spaces from a string.
LIKE Searches for specific patterns within string values.
REGEXP Provides advanced pattern matching capabilities for string manipulation.
ASCII/CHAR Work with character codes and convert them to corresponding characters.
CONCAT_WS Concatenates multiple string values with a specified separator.

CONCAT Function in SQL

The CONCAT function in SQL is a powerful tool that allows users to combine multiple string values into a single string, making it easier to manage and manipulate data efficiently. With CONCAT, you can concatenate strings from different columns or tables, as well as include additional text or special characters between them.

Whether you want to merge first and last names, combine address components, or concatenate multiple fields for a specific output, the CONCAT function provides the flexibility and simplicity you need. By utilizing SQL’s CONCAT function, you can streamline your queries and achieve accurate and customized results.

“The CONCAT function is an invaluable asset in SQL, providing the means to effortlessly merge and manipulate text data. Its versatility empowers users to efficiently concatenate strings and customize the output according to their unique requirements.”
– SQL Expert

How to Use CONCAT in SQL

To utilize the CONCAT function in SQL, you simply need to specify the strings or values you want to concatenate within the CONCAT function, separated by commas. Here’s an example:

SELECT CONCAT(first_name, ' ', last_name) AS full_name
FROM customers;

In this example, the CONCAT function combines the first name and last name fields from the customers table, separating them with a space. The result is a new column named full_name that contains the merged names for each customer.

Benefits of CONCAT in SQL

The CONCAT function offers several advantages for efficient SQL data manipulation:

  • Simplicity: The CONCAT function is easy to use and requires minimal syntax, making it accessible for SQL users of all levels.
  • Flexibility: With CONCAT, you can concatenate not only strings but also other data types, such as numbers or dates, providing flexibility for diverse data operations.
  • Customization: By allowing the inclusion of additional text or characters between concatenated values, CONCAT grants users full control over the output format, enabling tailored and precise results.

Overall, the CONCAT function in SQL enhances data management capabilities, enabling users to effortlessly merge and manipulate text data according to their specific needs.

SUBSTRING Function in SQL

In SQL, the SUBSTRING function is a powerful tool that allows users to extract a specific portion of a string based on defined criteria. This function is especially useful when dealing with large amounts of text data and can help simplify complex queries.

Example usage:

The SUBSTRING function takes three parameters: the input string, the starting position, and the length of the desired substring. For instance, consider the following SQL statement:

SELECT SUBSTRING('Hello, World!', 8, 5) AS Result;

This query will return the substring “World” starting from the 8th position with a length of 5 characters.

By utilizing the SUBSTRING function, users can extract relevant information from larger strings and tailor their data manipulations to specific requirements.

Advantages of the SUBSTRING function:

  • Extract specific portions of text data.
  • Facilitate data cleaning and transformation.
  • Optimize data retrieval by filtering out unnecessary information.

Here is an example of how the SUBSTRING function can be applied in a practical scenario:

Original String Extracted Substring
‘Product ID: 12345’ ‘12345’
‘Order Date: 2022-01-01’ ‘2022-01-01’
‘Customer Name: John Doe’ ‘John Doe’

The SUBSTRING function proves particularly useful when working with data that follows a consistent format, as it allows for efficient extraction of specific fields or values.

Overall, the SUBSTRING function in SQL empowers users to manipulate and manage text data with precision, providing flexibility and customization options for their queries.

REPLACE Function in SQL

The REPLACE function in SQL is a powerful tool that allows you to easily substitute a specific portion of a string with a new value. It comes in handy when you need to make changes to your data without rewriting the entire string.

With the REPLACE function, you can specify the string you want to modify, the section you want to replace, and the new value you want to insert. This function is particularly useful when dealing with textual data in databases, as it provides a flexible and efficient way to update and manipulate strings.

Here’s the basic syntax of the REPLACE function:

REPLACE(string, old_value, new_value)

Let’s say you have a table called “Customers” with a column named “Emails” that contains email addresses. If you want to replace all occurrences of the domain “example.com” with “newdomain.com” in the email addresses, you can use the REPLACE function in your SQL query like this:

UPDATE Customers SET Emails = REPLACE(Emails, 'example.com', 'newdomain.com')

This query will update all email addresses that contain “example.com” and replace it with “newdomain.com”. It allows you to quickly and efficiently make changes to your data, saving you time and effort.

The REPLACE function is not limited to a specific database system and can be used in various SQL implementations. It is a versatile function that helps you manage and manipulate your data effectively.

UPPER and LOWER Functions in SQL

In SQL, the UPPER and LOWER functions are powerful tools that allow users to manipulate text data by converting it to uppercase or lowercase, respectively. These functions offer a simple yet effective way to standardize the case of text in SQL queries and operations.

Let’s take a closer look at these functions:

UPPER Function

The UPPER function in SQL converts all characters in a given string to uppercase. It is particularly useful when you want to ensure consistency in your data or perform case-insensitive comparisons. Here’s an example:

“SELECT UPPER(last_name) FROM employees;

This query retrieves the last names of employees from the “employees” table and converts them to uppercase using the UPPER function.

LOWER Function

The LOWER function, on the other hand, converts all characters in a string to lowercase. It can be used in a variety of scenarios, such as ensuring case-insensitive searches or normalizing data. Here’s an example:

“SELECT LOWER(city) FROM customers;

This query retrieves the cities of customers from the “customers” table and converts them to lowercase using the LOWER function.

The UPPER and LOWER functions are incredibly versatile and can be combined with other SQL functions to achieve even more complex manipulations. By utilizing these functions, you can maintain consistency in your data and perform efficient text transformations.

Benefits of Using UPPER and LOWER Functions in SQL

There are several benefits to using the UPPER and LOWER functions in SQL:

  • Consistency: By converting text to uppercase or lowercase, you can ensure uniformity in your data.
  • Case-insensitive operations: These functions enable case-insensitive searches and comparisons, eliminating discrepancies caused by different cases.
  • Data normalization: Converting text to a standardized case can help in data normalization, making it easier to analyze and manipulate.
  • Enhanced readability: Uppercase or lowercase text can improve the readability of your queries and reports.

Overall, the UPPER and LOWER functions in SQL provide a simple yet powerful way to manipulate and standardize text data. Their ease of use and wide range of applications make them indispensable tools for SQL developers and data analysts.

LENGTH Function in SQL

In SQL, the LENGTH function plays a crucial role in determining the length, represented by the number of characters, of a given string. This function is particularly useful when working with text data and performing various operations based on the length of strings in a database.

The LENGTH function syntax in SQL is as follows:

LENGTH(string_expression)

Where:

  • string_expression is the input string whose length we want to find.

The result of the LENGTH function is a numeric value representing the length of the input string. This value is determined by counting the number of characters in the string, including spaces and special characters.

To provide a clearer understanding of the LENGTH function, let’s consider an example:

Example:

Suppose we have a table called customers with a column named name that stores the names of customers. We want to find the length of each customer’s name.

Here is a sample table:

id name
1 John Doe
2 Jane Smith
3 Michael Johnson

By applying the LENGTH function to the name column, we can retrieve the length of each customer’s name:

SELECT name, LENGTH(name) AS name_length FROM customers;

The resulting output would be:

name name_length
John Doe 8
Jane Smith 10
Michael Johnson 15

As shown in the table, the name_length column displays the length of each customer’s name, obtained using the LENGTH function. This information can be useful for various purposes, such as sorting data based on name length or filtering records based on a specific length criterion.

In summary, the LENGTH function in SQL is an essential tool for calculating the length of a string, enabling efficient manipulation and analysis of text data in databases.

TRIM Function in SQL

In SQL, the TRIM function plays a crucial role in data cleansing and manipulation by removing leading and trailing spaces from a string. It is especially useful when dealing with user-inputted data or when joining tables based on string values. The TRIM function helps ensure consistency and accuracy in the data stored within databases.

By applying the TRIM function, you can eliminate any unwanted spaces that may be unintentionally included in the beginning or end of a string value. This can prevent potential errors when performing SQL queries or comparisons based on string values.

Let’s take a closer look at the syntax of the TRIM function:

TRIM([trim_character FROM] string)

The trim_character parameter is optional and specifies the specific characters to be removed from the string. If not provided, the TRIM function will remove all leading and trailing spaces from the string by default.

Here’s an example showcasing the usage of the TRIM function:

SELECT TRIM('   Hello World   ') AS TrimmedString;
TrimmedString
Hello World

The TRIM function eliminates the leading and trailing spaces from the input string, resulting in the clean and trimmed string ‘Hello World’. This stripped-down value can now be effectively used in subsequent SQL operations without any unintended spaces interfering with the desired outcome.

With the TRIM function in SQL, you can ensure consistently formatted and accurate string values within your databases, enhancing data integrity and facilitating data analysis and manipulation.

LIKE Operator in SQL

In SQL, the LIKE operator is a powerful tool that allows users to search for specific patterns within string values. It enables precise filtering and retrieval of data based on user-defined conditions.

With the LIKE operator, you can search for patterns using wildcards. The two commonly used wildcards are:

  • % – Represents zero or more characters. For example, searching for 'a%' will match any value that starts with the letter ‘a’.
  • _ – Represents a single character. For example, searching for '_at' will match any value that has a three-letter word ending with ‘at’.

Let’s consider an example. Suppose we have a table called “employees” with a column named “full_name” that stores the names of employees. We want to retrieve all employees whose names start with the letter ‘J’. We can use the LIKE operator in the following way:

SELECT * FROM employees WHERE full_name LIKE 'J%';

This query will return all rows from the “employees” table where the “full_name” column starts with ‘J’. The 'J%' pattern specifies that we want any name that begins with ‘J’ followed by zero or more characters.

LIKE Operator with Wildcards

To further illustrate the usage of wildcards with the LIKE operator, consider the following examples:

Pattern Description
'S%' Matches any value that starts with the letter ‘S’.
'%a' Matches any value that ends with the letter ‘a’.
'%o%' Matches any value that contains the letter ‘o’.
'_at' Matches any three-letter word ending with ‘at’.
'Jo%e' Matches any value that starts with ‘Jo’ and ends with ‘e’.

By leveraging the LIKE operator and its wildcards, you can perform advanced pattern matching and data retrieval operations on string values in your SQL queries, providing flexibility and precision to your data analysis tasks.

REGEXP Functions in SQL

In SQL, REGEXP (Regular Expression) functions offer powerful pattern matching capabilities, enabling advanced string manipulation within databases. These functions allow users to search for and match specific patterns within text data, providing a flexible and efficient way to handle complex string operations.

REGEXP functions utilize regular expressions, which are sequences of characters that define a search pattern. By leveraging these functions, users can perform pattern-based searches, replacements, extractions, and more. The REGEXP functions in SQL are particularly helpful when dealing with large datasets and complex string manipulations, as they provide a concise and efficient solution.

Commonly Used REGEXP Functions in SQL

Here are some commonly used REGEXP functions in SQL:

  • REGEXP_LIKE: This function checks if a specified pattern exists in a given string.
  • REGEXP_REPLACE: It substitutes occurrences of a specified pattern with a replacement string.
  • REGEXP_INSTR: This function returns the position of the first occurrence of a pattern within a string.
  • REGEXP_SUBSTR: It extracts substrings from a string based on a specified pattern.

By utilizing these REGEXP functions, users can unlock the full potential of SQL for advanced string manipulation. Let’s take a closer look at each of these functions and explore their capabilities through examples.

REGEXP_LIKE Function

The REGEXP_LIKE function checks whether a given string matches a specified pattern. It returns a Boolean value – either true or false – indicating whether the pattern is found within the string.

REGEXP_REPLACE Function

The REGEXP_REPLACE function allows users to substitute occurrences of a specified pattern within a string with a replacement string. This function is handy for performing find-and-replace operations on text data.

REGEXP_INSTR Function

The REGEXP_INSTR function returns the position of the first occurrence of a specified pattern within a string. This function is useful for locating specific patterns within text data, helping users identify the starting position of the pattern.

REGEXP_SUBSTR Function

The REGEXP_SUBSTR function extracts substrings from a given string based on a specified pattern. This function is helpful when users want to extract specific portions of a string that match a particular pattern.

REGEXP Function Description
REGEXP_LIKE Checks if a string matches a pattern
REGEXP_REPLACE Substitutes occurrences of a pattern with a replacement
REGEXP_INSTR Returns position of the first occurrence of a pattern
REGEXP_SUBSTR Extracts substrings based on a pattern

ASCII and CHAR Functions in SQL

In this section, we will discuss the ASCII and CHAR functions in SQL, which are essential tools for working with character codes and converting them to corresponding characters. These functions play a crucial role in various string manipulation operations within SQL databases.

ASCII Function

The ASCII function in SQL allows you to determine the numeric ASCII code representation of a specific character. By passing a character as an argument to the ASCII function, you can retrieve its ASCII code value. This function is particularly useful when you need to work with character codes and perform operations based on their numeric values.

CHAR Function

The CHAR function in SQL is the counterpart of the ASCII function. It enables you to convert a numeric ASCII code to its corresponding character. By passing an ASCII code value as an argument to the CHAR function, you can retrieve the character associated with that code. This function comes in handy when you need to convert character codes back into readable characters.

Example:

Suppose you have a table that stores employee information, and the ASCII code of each employee’s first name is also recorded. You can use the CHAR function to retrieve the corresponding characters:

First Name ASCII Code
John 74
Jane 74
Michael 77

By applying the CHAR function to the ASCII code values in the table, you can obtain the following results:

First Name ASCII Code Character
John 74 J
Jane 74 J
Michael 77 M

The ASCII and CHAR functions provide a powerful means of working with character codes and converting them to meaningful characters. They offer flexibility and convenience when dealing with text data in SQL databases.

CONCAT_WS Function in SQL

In SQL, the CONCAT_WS function is a powerful tool that allows you to concatenate multiple string values with a specified separator. It stands for “Concatenate With Separator,” and it provides a convenient way to combine strings while automatically adding the desired separator between them.

The CONCAT_WS function takes two or more string values and joins them together using a specified separator. This separator can be any character or string that you choose, such as a comma, space, hyphen, or even a custom phrase. The function then returns a single string that contains the concatenated values separated by the specified separator.

“The CONCAT_WS function is incredibly useful when you need to combine multiple string values in SQL.”

To use the CONCAT_WS function, you simply need to provide the separator as the first argument, followed by the string values you want to concatenate. Here’s an example that illustrates the usage:

SELECT CONCAT_WS(', ', 'John', 'Doe', 'is', 'a', 'SQL', 'expert') AS concatenated_string;

This query will return the following result:

concatenated_string
John, Doe, is, a, SQL, expert

As you can see, the CONCAT_WS function has combined the individual string values “John,” “Doe,” “is,” “a,” “SQL,” and “expert” into a single string, with each value separated by a comma and a space.

Using the CONCAT_WS function can greatly simplify your SQL queries when dealing with string concatenation. It eliminates the need for manual string manipulation and ensures that your concatenated values are properly formatted with the specified separator.

Whether you need to concatenate names, addresses, or any other type of string data, the CONCAT_WS function in SQL offers a versatile and efficient solution. It is a valuable tool in your SQL repertoire for managing and manipulating text data effectively within databases.

LENGTH vs. DATALENGTH in SQL

In SQL, there are two commonly used functions for determining the length of a string: LENGTH and DATALENGTH. While both of these functions provide the same basic information, they have slightly different behaviors and use cases. Let’s compare and contrast them below:

LENGTH Function

The LENGTH function in SQL is used to calculate the number of characters in a given string. It disregards trailing spaces at the end of the string when determining its length. This function is primarily used for non-Unicode character data types.

DATALENGTH Function

On the other hand, the DATALENGTH function in SQL is used to calculate the number of bytes used to represent a string. It includes trailing spaces at the end of the string when determining its length. This function is suitable for both Unicode and non-Unicode character data types.

Let’s visualize the difference between these two functions with an example:

String Value LENGTH Result DATALENGTH Result
‘Hello!’ 6 6
‘Hello! ‘ 10 12
‘𝐇𝐞𝐥𝐥𝐨!’ 6 12

In the above table, we can see the difference in results between the LENGTH and DATALENGTH functions. The first row represents a string without any trailing spaces, and both functions yield the same result. However, in the second row, where trailing spaces are present, the DATALENGTH function accounts for them. In the third row, we have a Unicode string, and again, the DATALENGTH function considers the bytes required to represent the Unicode characters.

Based on this comparison, it’s essential to choose the appropriate function depending on the specific requirements of your SQL query. If you need the length of a string without trailing spaces, the LENGTH function is the right choice. However, if you require the inclusive length of a string with trailing spaces or want to handle Unicode characters, the DATALENGTH function is the better option.

Conclusion

In conclusion, this article has explored the capabilities of SQL String Functions in efficiently manipulating and managing text data within databases. These functions play a crucial role in enhancing SQL queries and performing various string operations with ease.

By understanding and utilizing SQL String Functions effectively, users can extract, concatenate, replace, and convert text data as per their requirements. Functions like CONCAT, SUBSTRING, REPLACE, UPPER/LOWER, LENGTH, TRIM, LIKE, REGEXP, ASCII, CHAR, CONCAT_WS, and DATALENGTH offer powerful tools for text manipulation in SQL.

Whether it’s combining string values, extracting substrings, replacing specific portions of a string, converting case, calculating string lengths, removing leading/trailing spaces, searching for patterns, or working with character codes, SQL String Functions provide the necessary functionalities to handle text data effectively.

To sum up, a strong understanding of SQL String Functions empowers users to optimize their SQL queries, improve data management, and achieve more efficient text manipulation in databases. By implementing these functions appropriately, users can harness the full potential of SQL to handle text data effectively and efficiently.

FAQ

What are SQL String Functions?

SQL String Functions are a set of built-in functions in SQL that are specially designed to manipulate and manage text data efficiently within databases. These functions allow users to perform various operations on strings, such as concatenation, extraction, substitution, conversion, and more.

What are some commonly used SQL String Functions?

Some commonly used SQL String Functions include CONCAT, SUBSTRING, REPLACE, and UPPER/LOWER. These functions provide powerful capabilities for combining strings, extracting portions of strings, substituting values within strings, and converting string case, respectively.

What does the CONCAT function do in SQL?

The CONCAT function in SQL allows users to combine multiple string values into a single string. It is particularly useful when concatenating column values or adding additional text to an existing string.

How does the SUBSTRING function work in SQL?

The SUBSTRING function in SQL enables users to extract a portion of a string based on specific criteria. It requires specifying the starting position and the length of the substring to be extracted.

What is the purpose of the REPLACE function in SQL?

The REPLACE function in SQL is used to substitute a specific portion of a string with a new value. It is commonly used to replace certain characters, words, or patterns within a string.

How do the UPPER and LOWER functions function in SQL?

The UPPER and LOWER functions in SQL are used to convert text to uppercase and lowercase, respectively. They are helpful in normalizing data or performing case-insensitive comparisons.

What does the LENGTH function do in SQL?

The LENGTH function in SQL calculates the length of a given string, which refers to the number of characters in the string. It is often used to validate the length of input data or manipulate strings based on their length.

How does the TRIM function work in SQL?

The TRIM function in SQL is used to remove leading and trailing spaces from a string. It ensures that the string is clean and ready for further processing or comparison.

What is the purpose of the LIKE operator in SQL?

The LIKE operator in SQL allows users to search for specific patterns within string values. It supports the use of wildcard characters, such as % (matches any number of characters) and _ (matches a single character), to provide more flexible searching capabilities.

What are REGEXP functions in SQL used for?

REGEXP functions in SQL provide powerful pattern matching capabilities for advanced string manipulation. They allow users to search, extract, and replace strings based on regular expressions, which are patterns used to match specific combinations of characters.

How do the ASCII and CHAR functions function in SQL?

The ASCII function in SQL returns the ASCII code value of a specified character, while the CHAR function converts a given ASCII code to the corresponding character. These functions are useful when working with character codes and performing character-based operations.

What is the purpose of the CONCAT_WS function in SQL?

The CONCAT_WS function in SQL concatenates multiple string values with a specified separator. It is particularly useful when dealing with lists or combining strings with distinct delimiters.

What is the difference between LENGTH and DATALENGTH functions in SQL?

The LENGTH function in SQL calculates the length (number of characters) of a given string, while the DATALENGTH function calculates the length (number of bytes) of a given string. The difference is important when working with variable-length character sets, such as Unicode.

Avatar Of Deepak Vishwakarma
Deepak Vishwakarma

Founder

RELATED Articles

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.