Last three values sfdc trigger functionalty
You should try to keep the logic out of the trigger itself and try to put it into a handler class. This goes along with the one trigger per object pattern. What would happen if you needed to add another trigger on the same object that performed logic after update or before insert?
It looks like you might be replicating standard functionality with your split function. Make sure the standard split method not will meet your needs.