These are some code snippits. Mostly things that I’ve been asked by email or similar. If you have something that you think should be here feel free to send me suggestions at gwatts at uw.edu.

Using TString

Create a TString and then print out its contents.

using System;
namespace testload
{
    class Program
    {
        static void Main(string[] args)
        {
            var rs = new ROOTNET.NTString("hi there");
            Console.WriteLine("The contents of the string are: '{0}'", rs.Data());

            rs.Append(" how are you");
            Console.WriteLine("the new contests are '{0}'", rs.Data());
        }
    }
}

The operators “+”, etc., are not overloaded here. Instead, use the .NET facilities (in particular the StringBuilder object) and create a NTString object at the end.

Last edited Oct 19, 2011 at 6:32 AM by gwatts, version 2

Comments

No comments yet.