当前位置: 首页>>代码示例>>C#>>正文


C# StringBuffer类代码示例

本文整理汇总了C#中StringBuffer的典型用法代码示例。如果您正苦于以下问题:C# StringBuffer类的具体用法?C# StringBuffer怎么用?C# StringBuffer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StringBuffer类属于命名空间,在下文中一共展示了StringBuffer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MenuInputWidget

 public MenuInputWidget( Game game, Font font, Font boldFont )
     : base(game)
 {
     HorizontalAnchor = Anchor.LeftOrTop;
     VerticalAnchor = Anchor.BottomOrRight;
     this.font = font;
     this.boldFont = boldFont;
     chatInputText = new StringBuffer( 64 );
 }
开发者ID:Chameleonherman,项目名称:ClassicalSharp,代码行数:9,代码来源:MenuInputWidget.cs

示例2: StringBuffer_Peek

 public void StringBuffer_Peek()
 {
     StringBuffer buffer = new StringBuffer("Hello World");
     Assert.AreEqual(0, buffer.Position);
     Assert.AreEqual('H', (char)buffer.Peek());
     Assert.AreEqual(0, buffer.Position);
 }
开发者ID:ralf-lindberg-3bits,项目名称:blackbox,代码行数:7,代码来源:StringBufferTests.cs

示例3: toString

 public override string toString()
 {
   StringBuffer stringBuffer = new StringBuffer("AxisEntity: ");
   stringBuffer.append("tooltip = ");
   stringBuffer.append(this.getToolTipText());
   return stringBuffer.toString();
 }
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:7,代码来源:AxisEntity.cs

示例4: Awake

    void Awake() {
        inputBuffer = new StringBuffer();
        currentIllnesses = new List<Illness>();
        illnessesDef = new List<Illness>();
        tooSlowText = GameObject.Find("TooSlow");
        tooSlowText.SetActive(false);

        if (PlayerPrefs.GetInt("hardmode") == 1) {
            illnessesDef.Add(new Illness("Arrow", "udruldur", 2.1f));
            illnessesDef.Add(new Illness("Axe", "llurdul", 1.8f));
            illnessesDef.Add(new Illness("Eye", "lrlruld", 2.0f));
            illnessesDef.Add(new Illness("Hair", "udldrulu", 2.1f));
            illnessesDef.Add(new Illness("Green", "dudulrud", 2.3f));
            illnessesDef.Add(new Illness("Knife", "rulruudru", 2.3f));
        } else {
            illnessesDef.Add(new Illness("Arrow", "dudu", 0.8f));
            illnessesDef.Add(new Illness("Axe", "udlr", 0.8f));
            illnessesDef.Add(new Illness("Eye", "lurldr", 1.3f));
            illnessesDef.Add(new Illness("Hair", "uurdd", 1.3f));
            illnessesDef.Add(new Illness("Green", "lldrru", 1.5f));
            illnessesDef.Add(new Illness("Knife", "durulu", 1.5f));
        }

        gameManager = GetComponent<GameManager>();

        checkSequence = false;
    }
开发者ID:jacklp,项目名称:goldsmiths_gamejam_jan_2016,代码行数:27,代码来源:InputController.cs

示例5: Parse

        public IXmlAttributeValue Parse(IXmlAttributeValue xmlAttributeValue)
        {
            ReferenceNameAttributeValue attributeValue = new ReferenceNameAttributeValue();

            CompositeElement result = null;

            string rawValue = xmlAttributeValue.UnquotedValue;

            try
            {
                result = ParseTypeNameOrAttributeValue(rawValue);
            }
            catch (SyntaxError syntaxError)
            {
                result = (CompositeElement)syntaxError.ParsingResult;
                result = handleError(result, syntaxError);
            }

            attributeValue.AddChild(new XmlToken(L4NTokenNodeType.QUOTE, new StringBuffer(new string('\"', 1)), 0, 1));
            attributeValue.AddChild(result);
            int resultLegth = result.GetText().Length;
            if(resultLegth < rawValue.Length)
            {
                string suffix = rawValue.Substring(resultLegth);
                StringBuffer sb = new StringBuffer(suffix);
                XmlToken suffixToken = new XmlToken(L4NTokenNodeType.TEXT , sb, 0, suffix.Length);
                attributeValue.AddChild(suffixToken);
            }
            attributeValue.AddChild(new XmlToken(L4NTokenNodeType.QUOTE, new StringBuffer(new string('\"', 1)), 0, 1));

            return attributeValue;
        }
开发者ID:willrawls,项目名称:arp,代码行数:32,代码来源:ReferenceParser.cs

示例6: buf2String

        /**
         * convert byte array to Hex String.
         *
         * @param info - the propmt String
         * @param buf - the byte array which will be converted
         * @param offset - the start position of buf
         * @param length - the converted length
         * @param isOneLine16 - if true 16 bytes one line, false all bytes in one line
         * @return Hex String
         */
        public static string buf2String(string info, byte[] buf, int offset,
			int length, bool oneLine16)
        {
            int i, index;

            StringBuffer sBuf = new StringBuffer();
            sBuf.Append(info);

            for (i = 0 + offset; i < length + offset; i++)
            {
                if (i % 16 == 0)
                {
                    if (oneLine16)
                    {
                        sBuf.Append(lineSeperate);
                    }
                } else if (i % 8 == 0)
                {
                    if (oneLine16)
                    {
                        sBuf.Append("   ");
                    }
                }
                index = buf[i] < 0 ? buf[i] + DEFAULT_TABLE_LENGTH : buf[i];
                sBuf.Append(convertTable[index]);
            }
            return sBuf.ToString();
        }
开发者ID:Coopermine,项目名称:P25M_PRINTER,代码行数:38,代码来源:ByteConverter.cs

示例7: StringBuffer_Create

 public void StringBuffer_Create()
 {
     StringBuffer buffer = new StringBuffer("Hello World");
     Assert.AreEqual("Hello World", buffer.Content);
     Assert.AreEqual(11, buffer.Length);
     Assert.AreEqual(0, buffer.Position);
 }
开发者ID:ralf-lindberg-3bits,项目名称:blackbox,代码行数:7,代码来源:StringBufferTests.cs

示例8: StringBuffer_Rewind

 public void StringBuffer_Rewind()
 {
     StringBuffer buffer = new StringBuffer("Hello World");
     Assert.IsTrue(buffer.Seek(6));
     Assert.AreEqual(6, buffer.Position);
     buffer.Rewind();
     Assert.AreEqual(0, buffer.Position);
 }
开发者ID:ralf-lindberg-3bits,项目名称:blackbox,代码行数:8,代码来源:StringBufferTests.cs

示例9: ByteArrayToHexString

        private static string ByteArrayToHexString(byte[] b)
        {
            StringBuffer resultSb = new StringBuffer();
            for (int i = 0; i < b.Length; i++)
                resultSb.Append(ByteToHexString(b[i]));

            return resultSb.ToString();
        }
开发者ID:MicahelWang,项目名称:XamarinSamples,代码行数:8,代码来源:MD5Util.cs

示例10: GetBuffer

 private StringBuffer GetBuffer()
 {
   if (this._buffer == null)
     this._buffer = new StringBuffer(4096);
   else
     this._buffer.Position = 0;
   return this._buffer;
 }
开发者ID:tanis2000,项目名称:FEZ,代码行数:8,代码来源:JsonTextReader.cs

示例11: IsExtendedTest

    public void IsExtendedTest(string path, bool expected)
    {
        StringBuffer sb = new StringBuffer();
        sb.Append(path);
        Assert.Equal(expected, PathInternal.IsExtended(sb));

        Assert.Equal(expected, PathInternal.IsExtended(path));
    }
开发者ID:shmao,项目名称:corefx,代码行数:8,代码来源:PathInternal.Windows.Tests.cs

示例12: JsonTextReader

    /// <summary>
    /// Initializes a new instance of the <see cref="JsonReader"/> class with the specified <see cref="TextReader"/>.
    /// </summary>
    /// <param name="reader">The <c>TextReader</c> containing the XML data to read.</param>
    public JsonTextReader(TextReader reader)
    {
      if (reader == null)
        throw new ArgumentNullException("reader");

      _reader = reader;
      _buffer = new StringBuffer(4096);
      _currentLineNumber = 1;
    }
开发者ID:284247028,项目名称:MvvmCross,代码行数:13,代码来源:JsonTextReader.cs

示例13: toString

 public override string toString()
 {
   StringBuffer stringBuffer = new StringBuffer("CategoryLabelEntity: ");
   stringBuffer.append("category=");
   stringBuffer.append((object) this.key);
   stringBuffer.append(new StringBuffer().append(", tooltip=").append(this.getToolTipText()).toString());
   stringBuffer.append(new StringBuffer().append(", url=").append(this.getURLText()).toString());
   return stringBuffer.toString();
 }
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:9,代码来源:CategoryLabelEntity.cs

示例14: setUp

	public void setUp() {
		aMap = new ExtendableMap();
		aMap.addBidirectionalLink("A", "B", 5.0);
		aMap.addBidirectionalLink("A", "C", 6.0);
		aMap.addBidirectionalLink("B", "C", 4.0);
		aMap.addBidirectionalLink("C", "D", 7.0);
		aMap.addUnidirectionalLink("B", "E", 14.0);

		envChanges = new StringBuffer();
	}
开发者ID:PaulMineau,项目名称:AIMA.Net,代码行数:10,代码来源:MapAgentTest.cs

示例15: StringBuffer

 /// <summary>
 /// Instantiate the buffer with a copy of the specified StringBuffer.
 /// </summary>
 public StringBuffer(StringBuffer initialContents)
     : base(0)
 {
     // We don't pass the count of bytes to the base constructor, appending will
     // initialize to the correct size for the specified initial contents.
     if (initialContents != null)
     {
         Append(initialContents);
     }
 }
开发者ID:AtsushiKan,项目名称:coreclr,代码行数:13,代码来源:StringBuffer.cs


注:本文中的StringBuffer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。