Skip to content

Instantly share code, notes, and snippets.

@kemiller2002
Created August 31, 2016 09:32
Show Gist options
  • Save kemiller2002/ae80551a36c8073403b03e720e30613b to your computer and use it in GitHub Desktop.
Save kemiller2002/ae80551a36c8073403b03e720e30613b to your computer and use it in GitHub Desktop.
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