I want to append a carriage return (ASCII 13) and line feed (ASCII 10) to a string.
My variable is as follows:
string = "hello world"
Could someone please show me the syntax to add the two control characters.
Brian.
Carriage Return Line Feed
Moderator: Benj
-
Brian Walsh
- Posts: 29
- Joined: Thu Jan 14, 2010 10:43 pm
- Has thanked: 3 times
-
Sean
- Valued Contributor

- Posts: 548
- Joined: Tue Jun 26, 2007 11:23 am
- Has thanked: 6 times
- Been thanked: 44 times
Re: Carriage Return Line Feed
Hello Brian,
One way to add carriage return and line feed to a string is to make a string containing only these characters, and add it to any other string as required. This process allows Flowcode to maintain correct control of the lengths of the strings involved.
First, use a string block to create a string called CrLf and initialise it with a 2 character string, eg. "xx".
Next, use a calculation block to access the string as an array and change the two characters to the unprintable CR and LF values:
CrLf[0] = 0x0d
CrLf[1] = 0x0a
The CrLf string can then be used in Flowcode string blocks to add the characters to other strings.
One way to add carriage return and line feed to a string is to make a string containing only these characters, and add it to any other string as required. This process allows Flowcode to maintain correct control of the lengths of the strings involved.
First, use a string block to create a string called CrLf and initialise it with a 2 character string, eg. "xx".
Next, use a calculation block to access the string as an array and change the two characters to the unprintable CR and LF values:
CrLf[0] = 0x0d
CrLf[1] = 0x0a
The CrLf string can then be used in Flowcode string blocks to add the characters to other strings.