Skip to content

Instantly share code, notes, and snippets.

public class ProtectionConfig
{
public string Path { get; set; }
public string ConfigurationPath { get; set; }
public string OutPutPath { get; set; }
public CancellationToken cancellationToken { get; set; }
}
var config = new ProtectionConfig
{
public void ProtectApplication(string path, string configurationPath, string outPutPath, CancellationToken cancellationToken)
{
// ...
}
var address = "One Infinite Loop, Cupertino 95014";
var cityZipCodeRegex = new Regex(@"/ ^[^,\\] +[,\\\s] + (.+?)\s * (\d{ 5 })?$/").Matches(address);
var city = cityZipCodeRegex[0].Value;
var zipCode = cityZipCodeRegex[1].Value;
saveCityZipCode(city, zipCode);
const address = "One Infinite Loop, Cupertino 95014";
var cityZipCodeRegex = new Regex(@"/ ^[^,\\] +[,\\\s] + (.+?)\s * (\d{ 5 })?$/").Matches(address);
saveCityZipCode(
cityZipCodeRegex[0].Value,
cityZipCodeRegex[1].Value
);
Bike MountainBike = new(){
brand = "Trek",
model = "MX Mountain",
color = "Green"
};
void paintBike(Bike mountainBike, string color){
mountainBike.color = color;
}
getUserInfo();
getClientData();
getCustomerRecord();
var currentDate = DateTime.Now.ToString("YYYY/MM/DD");
var yyyymmdstr = DateTime.Now.ToString("YYYY/MM/DD");
Bike MountainBike = new(){
bikeBrand = "Trek",
bikeModel = "MX Mountain",
bikeColor = "Green"
};
void paintBike(Bike mountainBike, string color){
mountainBike.bikeColor = color;
}