robik / ConsoleD

Because colors are awesome.
63 stars 11 forks source link

How to update part of string? #33

Open bubnenkoff opened 8 years ago

bubnenkoff commented 8 years ago

For example I am printing: xxx and then I need print: yy

But xxx is 3 symbols, and if I will overwrite 2 I will get: yyx

is there any way to prevent it?

adamdruppe commented 8 years ago

On Tue, Sep 13, 2016 at 03:48:09AM -0700, Dmitry Bubnenkov wrote:

But xxx is 3 symbols, and if I will overwrite 2 I will get: yyx

is there any way to prevent it?

print "yy "

with the extra space at the end you will explicitly erase the third char.

vladdeSV commented 8 years ago

Pardon previous message, for some reason thought this was my repo.

Apologies.

adamdruppe commented 8 years ago

On Tue, Sep 13, 2016 at 04:31:57AM -0700, Vladde Nordholm wrote:

Pardon previous message, for some reason thought this was my repo.

err it is!