BBGamelib.flash.imp.Utils.RepeatString C# (CSharp) Method

RepeatString() public static method

public static RepeatString ( int n, string str = " " ) : string
n int
str string
return string
		public static string RepeatString(int n, string str=" "){
			string s = "";
			for(int i=0; i<n; i++)
				s += str;
			return s;
		}
	}

Usage Example

        public string trace(int indent = 0)
        {
            string indent0 = Utils.RepeatString(indent);
            string indent2 = Utils.RepeatString(indent + 2);
            string indent4 = Utils.RepeatString(indent + 4);

            string s = indent0 + "[SWF:" + prefix + "]\n" +
                       indent2 + "Header:\n" +
                       indent4 + "Version: " + version + "\n" +
                       indent4 + "FlashVersion: " + flashVersion + "\n" +
                       indent4 + "FrameRate: " + frameRate + "\n" +
                       indent4 + "FrameSize: " + frameSize + "\n" +
                       indent4 + "FrameRate: " + frameRate + "\n";
            int    count        = 0;
            string defineString = "";

            for (int i = 0; i < chId_defs.Length; i++)
            {
                TagDefine define = chId_defs[i];
                if (define != null)
                {
                    count++;
                    defineString += define.trace(indent + 4);
                }
            }

            s += indent2 + "Defines(" + chId_defs.Length + "):\n";
            s += defineString;
            return(s);
        }
All Usage Examples Of BBGamelib.flash.imp.Utils::RepeatString