本文整理汇总了C#中System.Text.StringBuilder.toString方法的典型用法代码示例。如果您正苦于以下问题:C# StringBuilder.toString方法的具体用法?C# StringBuilder.toString怎么用?C# StringBuilder.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Text.StringBuilder
的用法示例。
在下文中一共展示了StringBuilder.toString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: toURIQuery
public String toURIQuery()
{
StringBuilder sb = new StringBuilder();
sb.append("https=");
sb.append(https);
sb.append("&saml=");
sb.append(saml);
sb.append("&refs=");
sb.append(refs);
sb.append("&no_default_t=");
sb.append(noDefaultT);
sb.append("&no_default_p=");
sb.append(noDefaultP);
sb.append("&no_default_m=");
sb.append(noDefaultM);
sb.append("&uric=");
sb.append(uric);
sb.append("&cid=");
sb.append(cid);
return sb.toString();
}
示例2: getTrustParameters
public String getTrustParameters() {
StringBuilder sb = new StringBuilder();
sb.append(MimeType.PARAM_HTTPS);
sb.append("=");
sb.append(isHttps()? "true" : "false");
sb.append(";");
sb.append(MimeType.PARAM_SAML);
sb.append("=");
sb.append(isSaml()? "true" : "false");
return sb.toString();
}
示例3: toString
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append("ResolverFlags (");
sb.append(toURIQuery());
sb.append(")");
return sb.toString();
}
示例4: mHereDocContents
private void mHereDocContents()
{
EnterRule_HereDocContents();
EnterRule("HereDocContents", 121);
TraceIn("HereDocContents", 121);
try
{
// Php.g:736:2: ()
DebugEnterAlt(1);
// Php.g:736:4:
{
DebugLocation(736, 4);
if (state.backtracking == 0)
{
// Please see also Code2Xml.Languages.ANTLRv3.Core.ExtensionForParser
var sb = new StringBuilder();
while (input.LA(1) != '\n') {
sb.append((char)input.LA(1));
input.consume();
}
input.consume();
var hereDocName = sb.toString().TrimEnd();
var hdnl = hereDocName.length();
while (true) {
var matchEnd = true;
for (int i = 0; i < hdnl; i++) {
if (input.LA(1) != hereDocName.charAt(i)) {
matchEnd = false;
break;
}
input.consume();
}
if (matchEnd == false) {
while (input.LA(1) != '\n') {
input.consume();
}
input.consume();
} else {
break;
}
}
}
}
}
finally
{
TraceOut("HereDocContents", 121);
LeaveRule("HereDocContents", 121);
LeaveRule_HereDocContents();
}
}
示例5: CreateDocument
private Document CreateDocument(int n, string indexName,
int numFields, string format)
{
StringBuilder sb = new StringBuilder();
Document doc = new Document();
string id = string.Format(CultureInfo.InvariantCulture, format, n);
doc.Add(NewStringField("id", id, Field.Store.YES));
doc.Add(NewStringField("indexname", indexName, Field.Store.YES));
sb.append("a");
sb.append(n);
doc.Add(NewTextField("field1", sb.toString(), Field.Store.YES));
sb.append(" b");
sb.append(n);
for (int i = 1; i < numFields; i++)
{
doc.Add(NewTextField("field" + (i + 1), sb.toString(), Field.Store.YES));
}
return doc;
}
示例6: testRandomQueries2
public virtual void testRandomQueries2()
{
char[] chars = new char[] { 'a', '1', '|', '&', ' ', '(', ')', '"', '-', '~' };
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 1000; i++)
{
sb.Length = (0);
int queryLength = Random().Next(20);
for (int j = 0; j < queryLength; j++)
{
sb.append(chars[Random().Next(chars.Length)]);
}
Parse(sb.toString()); // no exception
ParseKeyword(sb.toString(), TestUtil.NextInt(Random(), 0, 1024)); // no exception
}
}
示例7: toString
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append("QXRI=");
sb.append(qxri);
sb.append(", trust=");
sb.append(trust);
sb.append(", uri=");
sb.append((uri == null)? "null" : uri.toASCIIString());
sb.append(", ref=");
sb.append(ref);
sb.append(", elapsed=");
sb.append(timeCompleted - timeStarted);
sb.append("ms\n\nXRDS = \n");
sb.append(xrds);
return sb.toString();
}