ConsoleD icon indicating copy to clipboard operation
ConsoleD copied to clipboard

How to update part of string?

Open bubnenkoff opened this issue 8 years ago • 3 comments

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?

bubnenkoff avatar Sep 13 '16 10:09 bubnenkoff

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.

adamdruppe avatar Sep 13 '16 11:09 adamdruppe

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

Apologies.

vladdeSV avatar Sep 13 '16 11:09 vladdeSV

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!

adamdruppe avatar Sep 13 '16 11:09 adamdruppe