41

I've got a specflow step table that I want to have the | (pipe) character as a part of the content.

Example:

Then the data should be
    | Field     | Value  |
    | SomeField | a|b|c  |

But this doesn't work. How can I escape the pipe character?

Community
  • 1
  • 1
viggity
  • 15,039
  • 7
  • 88
  • 96

1 Answers1

65

Bah. I can't believe I didn't find this earlier. You CAN escape a pipe with the backslash, but the specflow syntax highlighter gets confused by it.

Then the data should be
    | Field     | Value    |
    | SomeField | a\|b\|c  |
viggity
  • 15,039
  • 7
  • 88
  • 96
  • 3
    as a quick aside, if you're using SpecFlow, I highly recommend using SpecFlow Assist which is baked into the framework for mapping tables to your entity objects https://github.com/techtalk/SpecFlow/wiki/SpecFlow-Assist-Helpers – viggity Jul 30 '13 at 14:07