Create a gist now

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace TestOutVariable
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OutExamples
{
class Program
{
struct PersonInformation
{
public String Name;
public String PhoneNumber;
}
static void Main(string[] args)
{
string name;
var person = new PersonInformation { Name = "jenny", PhoneNumber = "867-5309" };
GetName(ref person, out name);
MakeNameCapitalized(ref name);
Console.WriteLine(person.Name);
}
static void GetName(ref PersonInformation person, out string name)
{
name = person.Name;
}
public static void MakeNameCapitalized(ref string name)
{
name = name[0].ToString().ToUpper() + String.Join("", name.Skip(1));
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment