![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | working with strings Could someone please explain why this happens like this PS 1 > $a = "_string" PS 2 > $a _string PS 3 > $b = "string $a_string" PS 4 > $b string I would expect $b to be "string _string_string" as it does if I do this PS 8 > $b = "string" + $a + "_string" PS 9 > $b string_string_string Thanks in advance Andy |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: working with strings This is because _ could be part of the name of the variable try this instead PS> $a = "_string" PS> $b = "string$($a)_string" PS> $b string_string_string "ASCHNEIDER146" <aschneider146@xxxxxx> wrote in message news:1190903446.175530.43700@xxxxxx
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) |
| Guest | Re: working with strings You could also avoid this by delimiting the variable with braces: $a = "_string" $b = "string ${a}_string" -- Kiron |
My System Specs![]() |
| | #4 (permalink) | ||||||||||||
| Guest | Re: working with strings On Sep 27, 7:30 am, ASCHNEIDER146 <aschneider...@xxxxxx> wrote:
Andy | ||||||||||||
My System Specs![]() | |||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using $ signs in strings | greatbarrier86 | PowerShell | 11 | 05-21-2008 12:06 PM |
| -f paramater in strings | thomas lee | PowerShell | 4 | 04-02-2008 04:33 PM |
| comparing secure strings... | Ben Christian | PowerShell | 3 | 04-02-2008 03:42 PM |
| Comparing strings - is it a bug? | Tibor Soos | PowerShell | 7 | 03-13-2008 08:04 PM |
| Resource strings | Jarlaxle | PowerShell | 3 | 03-04-2008 02:04 PM |