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
  • 37,241
  • 25
  • 195
  • 267
Shachaf.Gortler
  • 5,655
  • 14
  • 43
  • 71

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
  • 23,309
  • 10
  • 44
  • 76