JSFiddle - React, Tailwind, and code Playground

JavaScript

var str='abc$123'; 
var str1=str.substring(0,10);