how to count characters in word in Java

Hello viewers today's topic is how to online count characters in word in Java. There are Many different types of methods for the specific reasons. You can also count words, letters, paragraphs by using the php,  jQuery,  JavaScript. 

Online Word Counter tool using this method. If you follow any Online Character Count tool then you must found the word counter.

Why use online word counter tool:

Word counter tool helps you to count words within a paragraph or many paragraphs to save your time and patience.  

Many of us are using this online word counter tool in daily basis. Mainly the blogger,  content creator like seo Experts are using this tools.  

Here we telling you the source code of a word counter tool.: 


<script src="https://cdn.quilljs.com/1.0.0/quill.js"></script>


HTML Code:

<div id="editor"></div>
<div id="counter">0 words</div>

---------------------------------------------------------------------------

<style>
#editor {
  border: 1px solid #ccc;
}
#counter {
  border: 1px solid #ccc;
  border-width: 0px 1px 1px 1px;
  color: #aaa;
  padding: 5px 15px;
  text-align: right;
}
</style>

---------------------------------------------------------------------------

<script>
Quill.register('modules/counter', function(quill, options) {
  var container = document.querySelector(options.container);
  quill.on('text-change', function() {
    var text = quill.getText();
    if (options.unit === 'word') {
      container.innerText = text.split(/\s+/).length + ' words';
    } else {
      container.innerText = text.length + ' characters';
    }
  });
});

var quill = new Quill('#editor', {
  modules: {
    counter: {
      container: '#counter',
      unit: 'word'
    }
  }
});
</script>




Comments

Popular posts from this blog

Happy Valentines Day Images 2022 with Love Songs 2022

Valentine's Day and Valentine Gifts 2022

7 Unromantic Gifts to Avoid This Valentine's Day 2022