JSFiddle - React, Tailwind, and code Playground

HTML

<li id="test">&file</li>

JavaScript

$(document).ready(function() {  
   var m = $('#test').html();  
   var n = m.indexOf('&amp;')  
   var spanLetter = m.substr(n+5, 1);  
   /* Note that '&' is represent as &amp; in HTML and therefore, the logical, n+1 as start param will give 'a' as the result for spanLetter */
   var restString = m.substr(n+6, n.length);  
   alert(n);  
   alert('<span>' + spanLetter + '<span>');  
   alert(restString);  
});