本文整理汇总了C#中StringSet.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# StringSet.ToString方法的具体用法?C# StringSet.ToString怎么用?C# StringSet.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringSet
的用法示例。
在下文中一共展示了StringSet.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
public void Add()
{
StringSet ss = new StringSet();
ss.Add("foo");
ss.Add("foo");
ss.Add("bar");
Assert.IsTrue(ss["foo"]);
Assert.AreEqual(2, ss.Count);
Assert.AreEqual("foo\r\nbar\r\n", ss.ToString());
ss.Remove("bar");
Assert.AreEqual(1, ss.Count);
Assert.IsFalse(ss["fool"]);
ss = new StringSet(new string[] { "foo", "bar"});
ss.Add(new StringSet("baz"));
Assert.AreEqual(3, ss.Count);
}
示例2: ConstructParserErrorMessage
//Constructs the error message in situation when parser has no available action for current input.
// override this method if you want to change this message
public virtual string ConstructParserErrorMessage(ParsingContext context, StringSet expectedTerms)
{
if(expectedTerms.Count > 0)
return string.Format(Resources.ErrSyntaxErrorExpected, expectedTerms.ToString(", "));
else
return Resources.ErrParserUnexpectedInput;
}
示例3: ConstructParserErrorMessage
//Constructs the error message in situation when parser has no available action for current input.
// override this method if you want to change this message
public virtual string ConstructParserErrorMessage(ParsingContext context, StringSet expectedTerms) {
return string.Format(Resources.ErrParserUnexpInput, expectedTerms.ToString(" "));
}
示例4: Create
public void Create()
{
StringSet ss = new StringSet();
Assert.AreEqual(0, ss.Count);
Assert.AreEqual("", ss.ToString());
}
示例5: ConstructParserErrorMessage
//Constructs the error message in situation when parser has no available action for current input.
// override this method if you want to change this message
public virtual string ConstructParserErrorMessage(ParsingContext context, StringSet expectedTerms) {
return string.Format(O2_Misc_Microsoft_MPL_Libs.Irony_Parser.Resources.ErrParserUnexpInput, expectedTerms.ToString(" "));
}