Given a multiple line sentence or statement the task is to convert the whole statement in a
single line. See the example below.
Input : Hello welcome to geeksforgeeks. Output : Hello welcome to geeksforgeeks. Remove the new line between Hello and geeksforgeeks. Input : I love geeksforgeeks Output : I love geeksforgeeks
The idea is to use str_replace()
- New self vs. new static in PHP
- How to put string in array, split by new line in PHP ?
- Program to Insert new item in array on any position in PHP
- What's New in PHP 7 ?
- New Features of PHP 7.4
- Change string to a new character set
- ES6 | New String Methods
- Find minimum value of y for the given x values in Q queries from all the given set of lines
- GRE Geometry | Lines and Angles
- Set the limit of text length to N lines using CSS
- Serial I/O Lines in 8085 Microprocessor
- How to count text lines inside of DOM element ?
- Introduction to Two-Variable Linear Equations in Straight Lines
- Class 9 RD Sharma Solutions - Chapter 8 Introduction to Lines and Angles- Exercise 8.1
- Forms of Two-Variable Linear Equations - Straight Lines | Class 11 Maths
- How to remove the first character of string in PHP?
- How to remove extension from string in PHP?
- How to remove line breaks from the string in PHP?
- How to remove portion of a string after a certain character in PHP?
- How to remove all non-printable characters in a string in PHP?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.