Skip to content
Menu
Code for Java c
  • Home
  • Java
    • Java Examples
    • Java tutorials
  • C
    • C tutorials
    • C Examples
  • C++
    • C++ Tutorials
    • C++ Examples
  • Python
    • Python Tutorials
    • Python Examples
  • About
    • About me
    • contact us
    • disclaimer
    • Privacy Policy
Code for Java c

String function in C programming Language

Posted on March 12, 2017January 11, 2020

In this tutorial, we will discuss the String function in C programming Language

In this post, we are going to learn about pre-defined string functions in C language and how to use it

Strings are always enclosed by double quotes, Whereas , character is enclosed by single quotes in C likes other language

The string library function which is  built in C language to handle of String with some readymade functions

String functions is used coping one string to other string, concatenates two strings , finding the length of the string,String comparison and replace or insert strings etc……

string.h header file supports all the string functions in C language. and String functions are given below

1. strcat ()- Concatenates two string, Str2 can be concatenates  at the end of the str1

2. strncat() – Appends a portion of String to another
3. strcpy() – Copies String2  into String 1
4. strncpy() – Copies given number of characters of one String to another
5. strlen()- Gives the leanth of given String
6. strcmp() –
Return 0 value if String 1 is same as String 2.
Return < 0 ,if String 1<String 2.
Return >0 if String1>String2
7. strcmpi() – Same as strcmp() function but this function negotiates case “A” and “a” are treated as same
8. strchr() – Returns pointer to first occurrence of char in String 1
9. strrchr() –  Last occurrence of given character in a String is found
10. strstr() – Return pointer to first occirrence of String 2 in String 1
11. strrstr() –  Return pointer to last occirrence of String 2 in String 1
12. strdup() – Duplicates the given String
13. strlwr() – Convert string to lover case
14. strupr() – Convert string to upper case
15. strrev() – Reverses the given string
16. strset() – Sets all charecters in a string to given charecter
17. strnset() – It’s sets the portion of charecters in a string to given charecter
18. strtok() – Tokenizing given String using delimiter
Suggested post

Function in C language

Arithmetic function in C language
Arithmetic function with example in C language
Nested function in C language

Related

Recent Posts

  • Subtract two numbers using method overriding
  • PHP Star triangle Pattern program
  • Using function or method to Write temperature conversion : Fahrenheit into Celsius
  • Function or method:temperature conversion from Fahrenheit into Celsius – Entered by user
  • Write temperature conversion program: Fahrenheit into Celsius
  • How to write a program to convert Fahrenheit into Celsius

tag

Addition (6) Array (38) C++ language (91) C language (98) c sharp (23) Division (6) Function (29) if else (32) Java language (102) JavaScript (5) loops (137) Multiply (7) Oop (2) patterns (65) PHP (13) Python Language (38) Subtraction (7) temperature (20)

Archives

Categories

Address

Global information technology

Puloly south, PointPedro

Jaffna

Srilanka

©2025 Code for Java c | Powered by SuperbThemes