ssis - Adding hyphen in string -
i got formatting issue in ssis. have sets of telephone numbers text files , hyphen needs added format.
ex. 1234567890 formatted: 123-456-7890
im thinking using substring in expression derived column task. hope u can help. thanks!
public static string sethyphen(string str) { stringbuilder stringbuilder = new stringbuilder(); char ssnarr[] = str.tochararray(); for(int i=0;i<ssnarr.length;i++){ if(i == 2 || == 5){ stringbuilder.append(ssnarr[i] + "-"); }else{ stringbuilder.append(ssnarr[i]); } } return stringbuilder.tostring(); }
Comments
Post a Comment