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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -