In this small example, I will share with you getting string length in vue js. You can easily get string length in vue.js. We can get vue js get string length using “.length” attribute.

It seems very easy, but sometime we need to get our string length or size at time we need to get length using vue js.

you can see bellow sample code:

{{ myString.length }}

You can see bellow full example:

Example:

<!DOCTYPE html>
<html>
<head>
    <title>How to get string length in Vue JS? - ItSolutionStuff.com</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
  
<div id="app">
  
  <p>String : {{ myString }}</p>
  <p>String Length : {{ myString.length }}</p>
  
</div>
  
<script type="text/javascript">
  
    var app = new Vue({
      el: '#app',
      data: {
        myString: "This is ItSolutionStuff.com"
      }
    })
  
</script>
   
</body>
</html>

I hope it can help you…

#vue-js #javascript

Vue.js Get String Length Example
1 Likes112.65 GEEK