# Python code to remove newline character from string using replace() method
text = "A regular
expression is a sequence
of characters
that specifies a search
pattern. "
print(text.replace('
', ''))
my_list = ["Python
", "is
", "Fun
"]
new_list = []
print("Original List: ", my_list)
for i in my_list:
new_list.append(i.replace("
", ""))
print("After removal of new line ", new_list)