Question Treephet Phannaphop · May 3, 2019

Hi There

I created function to manage string as requirement  extract the first two letter of each word after space for example:

Text = "Review symptoms to report with patient"

After passed function it will be return "Resytorewipa"

ChangeFormat(desc)

   set desc = "Review symptoms to report with patient"
   q:$g(desc)=""
   SET delim=" "
   SET countdown=$LENGTH(desc,delim)
   set =1
   for
    {
        q:i>countdown
         set abbrv = $e($PIECE(desc,delim,i),1,2)   // But if I put w abbrv  I can get "Resytorewipa"
         set = i+1     
    }
   w abbrv

6
0 581