String Builder

REMOTE   TEXT  

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


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
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.
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.
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
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)
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++
Space Before Concatenate Character
This can help improve readability by putting a space between the ending encloser for the string and the string concatenator.
Feedback