title: What is the most effective way in systemVerilog to know how many words a string has?
body: <p>I have Strings in the following structure:</p>
  
  <p>cmd, addr, data, data, data, data, ……., \n</p>
  
  <p>For example:
  "write,A0001000,00000000, \n"</p>
  
  <p>I have to know how many words the String has.</p>
  
  <p>I know that I can go over the String and search for the number of commas, but is there more effective way to do it?</p>