1

I am making my custom implementation of DefaultStyledDocument. And sometimes, I need to know how many characters will be (or has been) inserted by the Document.insertString() method.

But I did not find how to compute it. (The method insertString() itself can't help me as it returns void).

So is it possible to compute this value ?

Thanks in advance.

loloof64
  • 5,252
  • 12
  • 41
  • 78

1 Answers1

2

Can you use the length() method? i.e.:

String s = "Example";     
int len = s.length();
tmwoods
  • 2,353
  • 7
  • 28
  • 55