Space in powershell

The following line does not work in Powershell because there is a space in between the single quotes.
run '(q . 'hello world')'

but this will work, because a space symbol is removed.
run '(q . 'hello_world')'

What am I dong wrong?

what about run '(q . "hello world")' ? so no ’ but "

1 Like

not really,…
This did not work:

run '(q . "hello world")'

but you gave me an idea to play with the quotes:
this worked:

run "(q . 'hello world')"

As @chiaadmin pointed, you have to mix your quotes. It needs to be either “‘’” or ‘“”’. When you have four same quotes in a row, they are interpreted in left to right order, as such the second quote will complement the first (that will be the end of your first sting), characters following that will be seen as garbage, the third quote will start the second string, and the fourth will close it.

You can look at those quotes as a kind of non-specific parenthesis, where interpreter/compiler cannot tell which one is left or right. When you mix them, it is known where every set starts/ends.

1 Like