String Builder

Updated: Oct 22, 2017

String Builder is used to convert multi-line string into code that can be copy pasted and used directly inside a programming language.



Input: Paste string below



Settings

Output: String Builder Text


Background Information

We all use text files everyday. Be it a list of file paths, names of people or things to do. There is often a need to quickly manipulate lines of text in a particular form. Sorting is one such operation. Read more at wikipedia.

Tags

TEXT  

Settings Explained

  • 1. Output Style

    The output style contains presets for various programming languages such as C#, Java, JavaScript & PHP. All the other settings are dependent upon this. You can select Custom if you want to customize the individual settings.

    C# & Java

    This is the setting for the C# & Java programming languages. The values for this preset are:-

    Enclose Character"
    Escape Character\
    Concatenate Character+
    Space before concatenate characterYes
    Start CharacterEmpty
    End Character;

    "{" +
    "    \"name\": \"John Doe\"," +
    "    \"age\": 69" +
    "}";

    JavaScript

    This is the setting for the JavaScript programming language. The values for this preset are:-

    Enclose Character'
    Escape Character\
    Concatenate Character+
    Space before concatenate characterYes
    Start CharacterEmpty
    End Character;

    '{' .
    '    "name": "John Doe",' .
    '    "age": 69' .
    '}';

    PHP

    This is the setting for the PHP programming language. The values for this preset are:-

    Enclose Character'
    Escape Character\
    Concatenate Character.
    Space before concatenate characterYes
    Start CharacterEmpty
    End Character;

    '{' .
    '    "name": "John Doe",' .
    '    "age": 69' .
    '}';

    Custom

    This allows you to customize the individual settings for the following:-

    • Enclosing Character
    • Escape Character
    • Concatenate Character
    • Space before concatenate character
    • Start Character
    • End Character

  • 2. Enclose Character

    This is the character with which strings on each line are surrounded. Typically, this is either double quote (") or single quote ('). Some languages such as PHP treat " differently in that variable substitutions are allowed. While in JavaScript, it is a matter of convenience as you can use whichever character (between " and ' that does not appear as a literal) as your string encloser.

  • 3. Escape Character

    If the enclosing character appears in the string, this character is used to escape it, thus making it a literal value. This is typically backslash (\) in most programming languages.

  • 4. Concatenate Character

    Each line of string is concatenated by this character. This is usually the plus (+) operator in most programming languages. In PHP it is the dot (.) operator

  • 5. Start Character

    In some languages such as C#, the first line of the string can start with special characters such as: @@ (verbatim string) or $ (format string)

  • 6. End Character

    This is the terminator at the very end of the last line of the output. Typically this is semi-colon (;) for languages modelled after C/C++

  • 7. Space Before Concatenate Character

    This can help improve readability by putting a space between the ending encloser for the string and the string concatenator.

 

Comments 0


History

Oct 22, 2017
Tool Launched