Replicate String - CSharp System

CSharp examples for System:String Replace

Description

Replicate String

Demo Code


using System.Net;
using System.IO;/*  w  w w. ja  v  a  2  s .c o  m*/
using System.Text.RegularExpressions;
using System.Web;
using System.Text;
using System.Collections.Generic;
using System;

public class Main{

        public static string Replicate(string character, int number)
        {
            if (number < 1)
            {
                return string.Empty;
            }

            StringBuilder str = new StringBuilder(character, number);

            return str.ToString();
        }
}

Related Tutorials