Technology Programming

How to Add CRLF to a String in Python

    • 1). Compute the value of the string you want to output and assign it to a Python variable, as in the following sample code:

      myString = "Average programmer salary"

    • 2). Add the CR control character to the end of the string by using Python's "+" string concatenation operator:

      myCRString = myString+'\r'

    • 3). Add the LF control character to the end of the string by using Python's "+" string concatenation operator:

      myCRLFString = myCRString+'\n'

      In the example, variable "myCRLFString" contains the initial string value with CR and LF added for correct output.

Related posts "Technology : Programming"

The Importance Of Having a WordPress Business Theme

Programming

Website Design Is Necessary For Your Website

Programming

The Most effective On line Paid Survey Evaluation

Programming

Adelaide SEO - Links And Keywords, How Should They Be Used

Programming

C Programming Compilers for Microcontrollers

Programming

How Should A DJ Make Music Logo That Is Distinct And Cool?

Programming

Call to Action Concepts for Small Businesses

Programming

Microsoft Access Databases in Office 365

Programming

Why web design is crucial for producing world class websites

Programming

Leave a Comment