This question is locked. New answers and comments are not allowed.
Hello there,
I'm using Version Q1 2012 Internal Build (2012.1.208.4)
i have made the following simple application:
Here i found a bug with "Clean Code" functionality when i have expression like this one: string.Format("Today is {0}" + ".", "Monday");
"Clean Code" makes it looks like string.Format(string.Format("Today is {0}."), "Monday"); , and the problem is that these two expressions are not the same, so i get FormatException.
I think that this suggestion might be helpful to resolve this bug.
1. string.Format("Today is {0}" + ".", "Monday"); should look like string.Format(string.Format("Today is {{0}}."), "Monday");
Yordan Todorov
I'm using Version Q1 2012 Internal Build (2012.1.208.4)
i have made the following simple application:
using
System;
using
System.Linq;
namespace
JustCodeStringFormatBug
{
class
Program
{
static
void
Main(
string
[] args)
{
string
stringBeforeJustCode =
string
.Format(
"Today is {0}"
+
"."
,
"Monday"
);
// Today is Monday.
string
stringAfterJustCode =
string
.Format(
string
.Format(
"Today is {0}."
),
"Monday"
);
// Format Exception
}
}
}
Here i found a bug with "Clean Code" functionality when i have expression like this one: string.Format("Today is {0}" + ".", "Monday");
"Clean Code" makes it looks like string.Format(string.Format("Today is {0}."), "Monday"); , and the problem is that these two expressions are not the same, so i get FormatException.
I think that this suggestion might be helpful to resolve this bug.
1. string.Format("Today is {0}" + ".", "Monday"); should look like string.Format(string.Format("Today is {{0}}."), "Monday");
Yordan Todorov