How to Get String Length in Vue JS?

By Hardik Savani July 6, 2023 Category : Vue.JS

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:


<!DOCTYPE html>



<title>How to get string length in Vue JS? -</title>

<script src=""></script>



<div id="app">

<p>String : {{ myString }}</p>

<p>String Length : {{ myString.length }}</p>


<script type="text/javascript">

var app = new Vue({

el: '#app',

data: {

myString: "This is"






I hope it can help you...

Tags :