![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Concatenate text string and text in variable with no space between Hi, From my powershell script I would like output a text string concatenates with some text contained in a $variable with no space before and after the $variable. Example: The email address of Rossi Mario (Acme) is mario.rossi@xxxxxx In my powershell script I have witten: write-host -foregroundcolor green "The email address of" $DisplayName "("$firm") is" $PrimarySmtpAddress but the output is The email address of Rossi Mario ( Acme) is mario.rossi@xxxxxx I don't want the space between ( and Acme. How can I do? I have written some text lines like: $text1 = "The email address of" $text2 = "(" $text3 = ")" $text4 = "is" #write-host -foregroundcolor green $text1 $DisplayName $text2$firm$text3 $text4 $PrimarySmtpAddress but I don't think that it is correct. Have you any idea? I'll wait your reply, thanks! |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Concatenate text string and text in variable with no space between You multiposted your question in a VB Script group and in a Server group. The group "microsoft.windows.powershell" would be the right place to post it, and at the same time it would be a good idea to check out this link in order to see the difference between "multiposting" (which gets you unpopular with respondents) and "crossposting" (which is fine when done in moderation): http://www.blakjak.demon.co.uk/mul_crss.htm "Minniti Sergio" <MinnitiSergio@xxxxxx> wrote in message news:1B50D615-8DA5-4F6A-AF9A-FAE40DBBDA1B@xxxxxx Quote: > Hi, > From my powershell script I would like output a text string concatenates > with some text contained in a $variable with no space before and after > the > $variable. > Example: > The email address of Rossi Mario (Acme) is mario.rossi@xxxxxx > > In my powershell script I have witten: > write-host -foregroundcolor green "The email address of" $DisplayName > "("$firm") is" $PrimarySmtpAddress > but the output is > The email address of Rossi Mario ( Acme) is mario.rossi@xxxxxx > > I don't want the space between ( and Acme. > How can I do? > I have written some text lines like: > $text1 = "The email address of" > $text2 = "(" > $text3 = ")" > $text4 = "is" > #write-host -foregroundcolor green $text1 $DisplayName $text2$firm$text3 > $text4 $PrimarySmtpAddress > > but I don't think that it is correct. > Have you any idea? I'll wait your reply, thanks! > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Concatenate text string and text in variable with no space between | PowerShell | |||
| How to concatenate a literal string and a variable value? | VB Script | |||
| Creating a Text string | PowerShell | |||
| how to get text string from description? | PowerShell | |||
| How to Concatenate text files? | PowerShell | |||