title: What's an elegant solution in beanshell for loops and arrays
body: <p>I'm working with beanshell to parse SWIFT data and need to extract values by referencing these SWIFT tags.  Right now, I statically get these values as such:</p>
  
  <pre><code>String getACRU = swiftMessage.getTagData("19A",":ACRU//");
  String getANTO = swiftMessage.getTagData("19A",":ANTO//");
  String getCHAR = swiftMessage.getTagData("19A",":CHAR//");
  String getCOUN = swiftMessage.getTagData("19A",":COUN//");
  String getEXEC = swiftMessage.getTagData("19A",":EXEC//");
  String getISDI = swiftMessage.getTagData("19A",":ISDI//");
  String getLADT = swiftMessage.getTagData("19A",":LADT//");
  String getLEVY = swiftMessage.getTagData("19A",":LEVY//");
  String getLOCL = swiftMessage.getTagData("19A",":LOCL//");
  String getLOCO = swiftMessage.getTagData("19A",":LOCO//");
  String getMARG = swiftMessage.getTagData("19A",":MARG//");
  String getOTHR = swiftMessage.getTagData("19A",":OTHR//");
  String getPOST = swiftMessage.getTagData("19A",":POST//");
  String getREGF = swiftMessage.getTagData("19A",":REGF//");
  String getSHIP = swiftMessage.getTagData("19A",":SHIP//");
  String getSPCN = swiftMessage.getTagData("19A",":SPCN//");
  String getSTAM = swiftMessage.getTagData("19A",":STAM//");
  String getSTEX = swiftMessage.getTagData("19A",":STEX//");
  String getTRAN = swiftMessage.getTagData("19A",":TRAN//");
  String getTRAX = swiftMessage.getTagData("19A",":TRAX//");
  String getVATA = swiftMessage.getTagData("19A",":VATA//");
  String getWITH = swiftMessage.getTagData("19A",":WITH//");
  String getCOAX = swiftMessage.getTagData("19A",":COAX//");
  String getACCA = swiftMessage.getTagData("19A",":ACCA//");
  </code></pre>
  
  <p>My question is two-fold: what's the best way to elegantly rewrite this and what is the best way in beanshell to add a method/function that would remove the first three characters, change the comma to a period and once all those values have been parsed out of the message, to add them all up?</p>