Spliting a string between "," : This is my original string,

    required:true,validType:'timegt['#timeofdaymeterslotonebegintime,#timeofdaymeterslotoneendtime']

I want to split into two. the output will be like
   
    required:true 
     validType:'timegt['#timeofdaymeterslotonebegintime,#timeofdaymeterslotoneendtime']

Can someone help me out with this.
   