2

I have a custom string formatter, that I want to use after using the Standard formatter, my custom string formatter uses the {0:SP} as its format prefix.

What I am trying to do is get this simple example to work

  String.Format("{{0}:SP}" , 1)

I am getting an exception:

base: {System.FormatException: Input string was not in a correct format.

What it the correct way to do this?

Cœur
  • 34,719
  • 24
  • 185
  • 251
Shachaf.Gortler
  • 5,491
  • 13
  • 40
  • 70

1 Answers1

4
String.Format("{{{0}:SP}}" , 1)

it is annoying but you have to put 2 of them inside if you want to display {1:SP}

Here is the original answer

Community
  • 1
  • 1
Mong Zhu
  • 21,868
  • 8
  • 38
  • 71