Home > Common Problem > body text

What are the string concatenation functions?

Release: 2019-06-15 13:56:33
Original
35366 people have browsed it

What are the string concatenation functions?

1. String connection function in C language:

strcat (target string, source string);

Append a copy of the source string to the target string, with the terminating null character in the target string overwritten by the first character of the source string, and concatenate the two strings to form a new string with a null character. In C, function prototypes exist in the header file.

For example:

#include <stdio.h>
#include <string.h>
int main ()
{
  char str[80];
  strcpy (str,"these ");
  strcat (str,"strings ");
  strcat (str,"are ");
  strcat (str,"concatenated.");
  puts (str);
  return 0;
}
Copy after login

Print result:

these strings are concatenated.

2. String concatenation or merging function in EXCEL:

##Usage method: CONCATENATE (cells that need to be connected, Cells that need to be connected, cells that need to be connected...)

Note: If there are other characters to be added in the middle (such as "-"), just add this character directly, but you must Add double quotes "" (also double quotes in English format).

Example: Connect "school code", "college code" and "college number" to become "student number".

What are the string concatenation functions?

The first one: concatenate the following strings; the second one: concatenate the following strings with "-".

Use connection Function:

What are the string concatenation functions?

##3. SQL string connection Function:

String connection function concat(str1,str2..) function direct connection

example:

What are the string concatenation functions?

The above is the detailed content of What are the string concatenation functions?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template