Carriage return (not string) in erlang?

I wonder if it is possible to print a carriage return without a line feed in erlang? i.e. equivalent printf("this will be replaced next time \r");to C.

I looked at the io: format () document and did not see anything. It seems to support ~ n, equivalent to the carriage + line return pairs ('\ n' in C).

thank.

+3
source share
3 answers

"\ r" is a valid escape sequence in Erlang. That way you can only do

io:format("\r").

Refer to the reference guide for other escape sequences.

+7
source

You can use \rin a string for the return character like this:

io:format("Counter value: ~b\r", [Counter])

, $\r .

+4

Doh. . ~c ASCII, ASCII- (13). .

io:format("Counter value: ~b~c", [Counter,13])

Still interested in something more elegant ...

thank.

0
source

All Articles