- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 35164 Articles for Programming
8K+ Views
The strtoupper() function is used to convert all the characters of a string to uppercase. It returns a character with all the characters as uppercase.Syntaxstrtoupper(str)Parametersstr − The string to convert. Required.ReturnThe strtoupper() function returns a character with all the characters as uppercase.ExampleThe following is an example − Live DemoOutputThe following is the output −LAPTOP
581 Views
The strtolower() function is used to convert all the characters of a string to lowercase. It returns a character with all the characters as lowercase.Syntaxstrtolower(str)Parametersstr − The string to convert. Required.ReturnThe strtolower() function returns a character with all the characters as lowercase.ExampleThe following is an example − Live DemoOutputsolaris
181 Views
The strtok() function is a tokenize string. It returns a string token.Syntaxstrtok(str, split)Parametersstr − The string to splitsplit − Specifies one or more split charactersReturnThe strtok() function returns a string token.ExampleThe following is an example − Live DemoOutputThe following is the output −Thisisit!
232 Views
The strstr() function is used to find the first occurrence of a string. Note − The function is case-sensitive. Syntax strstr(str, search, before) Parameters str − The string to search search − The string to search for before − A boolean value whose default is "false". If set to "true", it returns the part of the string before the first occurrence of the search parameter. Return The strstr() function returns the rest of string or false if the string is not found. Example The following is an example − Live Demo ... Read More
44 Views
The strspn() function returns number of characters found in the string from the charlist parameter.Syntaxstrspn(str,charlist,begin,len)Parametersstr − The string to searchcharlist − The characters to findbegin − Where to begin in the stringlen − Length of the stringReturnThe strspn() function returns number of characters found in the string from the charlist parameter. It returns false if string is not found.ExampleThe following is an example − Live DemoOutputThe following is the output −0
74 Views
The strripos() function is used find the position of the last occurrence of a string inside the another string. Note − The function is case-insensitive. Syntax striipos(str, find, begin) Parameters str − The string to search. Required. find − The string to find. Required. begin − Where to begin the search. Optional. Return The strripos() function returns the position of first occurrence of a string inside another string or else false if string is not found. Example The following is an example − Live Demo Output 8
186 Views
The strrev() function is used to reverse a string. It returns the reversed string.Syntaxstrrev(str)Parametersstr − The string to be reversedReturnThe strrev() function returns the reversed string.ExampleThe following is an example − Live DemoOutputThe following is the output −kcaJExampleLet us see another example − Live DemoOutputThe following is the output −7387
105 Views
The strrchr() function is used to find the last occurrence of a character in a string. Syntax strrchr(str, char) Parameters str − The string to search char − The character to find in the string. If char contains more than one character, then only the first is used. Return The strrchr() function returns all characters from the last occurrence of a string within another string, to the end of the main string. It returns FALSE if the character is not found. Example The following is an example − Live Demo Output web
251 Views
The strpos() function is used to find the position of first occurrence of a string inside another string.Syntaxstrpos(str, find, begin)Parametersstr − The string to searchfind − The string to findbegin − Where to begin the searchReturnThe strpos() function returns the position of first occurrence of a string inside another string or else false if string is not found.ExampleThe following is an example − Live DemoOutputThe following is the output −8ExampleLet us see another example − Live DemoOutputThe following is the output −4
155 Views
The strpbrk() function is used to search a string for a specific character. Syntax strpbrk(str, charlist) Parameters str − The string to search charlist − The characters to find Return The strpbrk() function returns a string starting from the character found, or false if it is not found. Example The following is an example − Live Demo Output yalam Example
To Continue Learning Please Login
Login with Google