Run Code
|
Code Wall
|
Users
|
Misc
|
Feedback
|
About
|
Login
|
Theme
|
Privacy
Пример применения необязательных аргументов
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { static void Display(string str, int start=0, int stop=-1) { if (stop<0) stop=str.Length; if(stop>str.Length|start<0|start>stop) return; for(int i=start;i<stop;i++) Console.Write(str[i]); Console.WriteLine(); } public static void Main(string[] args) { //Your code goes here Console.WriteLine("Пример использования необязательных аргументов"); Display("Серегин Игорь Алексеевич"); Display("Серегин Игорь Алексеевич", 7); Display("Серегин Игорь Алексеевич",7,13); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
eden
Interface constraints in generics
Fórum ➡ GroupJoin'ing Books and Orders ( with Zip'ped output ) ♦
StringFormatting
Boggle
code 1
Md5 hash
Simple Enum Parsing
123.0
Escape's Vanity Fair (Malformed \p {X} character escape)
Please log in to post a comment.