Browse Source

Surround repr with single quotes

pull/55/head
Ionite 1 year ago
parent
commit
ddc82c3d00
No known key found for this signature in database
  1. 5
      StabilityMatrix.Core/Extensions/StringExtensions.cs

5
StabilityMatrix.Core/Extensions/StringExtensions.cs

@ -17,11 +17,12 @@ public static class StringExtensions
new CodePrimitiveExpression(str),
writer,
new CodeGeneratorOptions {IndentString = "\t"});
var literal = writer.ToString();
// Replace split lines
literal = literal.Replace($"\" +{Environment.NewLine}\t\"", "");
// Surround with single quotes
literal = $"'{literal}'";
return literal;
}
}

Loading…
Cancel
Save