I have 5 string variables, and i have a moment which I want to store (concatenate) them into one with ; separator. but some of them sometimes might be empty ( "" ) and i want to skip them. so far I have this code
If ACL_PermissionFC.Length > 0 Then ACL_PermissionFC = ACL_PermissionFC.PadLeft(PaddingValue) & " [" & ACL_Type & "]" Else ACL_PermissionFC = ""
If ACL_PermissionM.Length > 0 Then ACL_PermissionM = ACL_PermissionM.PadLeft(PaddingValue) & " [" & ACL_Type & "]" Else ACL_PermissionM = ""
If ACL_PermissionRE.Length > 0 Then ACL_PermissionRE = ACL_PermissionRE.PadLeft(PaddingValue) & " [" & ACL_Type & "]" Else ACL_PermissionRE = ""
If ACL_PermissionRE.Length > 0 Then ACL_PermissionRE = ACL_PermissionRE.PadLeft(PaddingValue) & " [" & ACL_Type & "]" Else ACL_PermissionRE = ""
If ACL_PermissionLD.Length > 0 Then ACL_PermissionLD = ACL_PermissionLD.PadLeft(PaddingValue) & " [" & ACL_Type & "]" Else ACL_PermissionLD = ""
dim Permissions as String
Permissions= ACL_PermissionFC & ";" & ACL_PermissionFC & ";" & ACL_PermissionRE & ";" & ACL_PermissionLD & ";" & ACL_PermissionR & ";" & ACL_PermissionW
And when there are empty strings i get this ;;Has Read & Execute security [Allow];Has List Folder Contents security [Allow];Has Read security
how can i make it when a string is empty not to concatenate it? ( i dont want double ; or tripple)
String.JoinandString.Split.