Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ int _cdecl wmain(int argc, LPCWSTR argv[])
goto Exit;
}

if (! cbUsed) {
if (!cbUsed) {
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public object GetFormat(Type formatType)
public string Format(string format, object arg, IFormatProvider formatProvider)
{
// Check whether this is an appropriate callback
if (! this.Equals(formatProvider))
if (!this.Equals(formatProvider))
return null;

// Set default format specifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static void Main()
ResXResourceReader resReader = new ResXResourceReader(readStream);
foreach (DictionaryEntry item in resReader)
{
if (! (((string) item.Key) == "CentralStandardTime" ||
if (!(((string) item.Key) == "CentralStandardTime" ||
((string) item.Key) == "PalmerStandardTime" ))
resources.Add((string)item.Key, (string) item.Value);
}
Expand Down Expand Up @@ -118,7 +118,7 @@ private void DeserializeTimeZones()
{
// Time zone not in system; retrieve from resource
timeZoneString = resMgr.GetString("CentralStandardTime");
if (! String.IsNullOrEmpty(timeZoneString))
if (!String.IsNullOrEmpty(timeZoneString))
{
cst = TimeZoneInfo.FromSerializedString(timeZoneString);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// <Snippet35>
using System;
using System.Text;
Expand Down Expand Up @@ -50,7 +50,7 @@
throw new ArgumentException("The array has too many characters.");

if (chars.Length == 2) {
if (! Char.IsSurrogatePair(chars[0], chars[1]))
if (!Char.IsSurrogatePair(chars[0], chars[1]))
throw new ArgumentException("The array must contain a low and a high surrogate.");
else
return Char.ConvertToUtf32(chars[0], chars[1]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// <Snippet1>
using System;
using System.Text;
Expand Down Expand Up @@ -28,7 +28,7 @@
// Decode the string.
string str2 = cp1252.GetString(bytes);
Console.WriteLine($"String round-tripped: {str.Equals(str2)}");
if (! str.Equals(str2)) {
if (!str.Equals(str2)) {
Console.WriteLine(str2);
foreach (var ch in str2)
Console.Write("{0} ", Convert.ToUInt16(ch).ToString("X4"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// <Snippet3>
using System;
using System.Text;
Expand All @@ -20,7 +20,7 @@
byte[] bytes = cp1252r.GetBytes(str1);
string str2 = cp1252r.GetString(bytes);
Console.WriteLine($"Round-trip: {str1.Equals(str2)}");
if (! str1.Equals(str2)) {
if (!str1.Equals(str2)) {
Console.WriteLine(str2);
foreach (var ch in str2)
Console.Write("{0} ", Convert.ToUInt16(ch).ToString("X4"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// <Snippet7>
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -29,7 +29,7 @@
// Decode the ASCII bytes.
string str2 = enc.GetString(bytes);
Console.WriteLine($"Round-trip: {str1.Equals(str2)}");
if (! str1.Equals(str2)) {
if (!str1.Equals(str2)) {
Console.WriteLine(str2);
foreach (var ch in str2)
Console.Write("{0} ", Convert.ToUInt16(ch).ToString("X4"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// <Snippet4>
using System;
using System.Text;
Expand Down Expand Up @@ -41,7 +41,7 @@
try {
string str2 = enc.GetString(bytes);
Console.WriteLine($"Round-trip: {str1.Equals(str2)}");
if (! str1.Equals(str2)) {
if (!str1.Equals(str2)) {
Console.WriteLine(str2);
foreach (var ch in str2)
Console.Write("{0} ", Convert.ToUInt16(ch).ToString("X4"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// <Snippet2>
using System;
using System.Text;
Expand Down Expand Up @@ -25,7 +25,7 @@
// Decode the ASCII bytes.
string str2 = enc.GetString(bytes);
Console.WriteLine($"Round-trip: {str1.Equals(str2)}");
if (! str1.Equals(str2)) {
if (!str1.Equals(str2)) {
Console.WriteLine(str2);
foreach (var ch in str2)
Console.Write("{0} ", Convert.ToUInt16(ch).ToString("X4"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// <Snippet10>
using System;
using System.IO;
Expand Down Expand Up @@ -68,7 +68,7 @@
{
bool result = original.Equals(decoded);
Console.WriteLine($"original = decoded: {original.Equals(decoded, StringComparison.Ordinal)}");
if (! result) {
if (!result) {
Console.WriteLine("Code points in original string:");
foreach (var ch in original)
Console.Write("{0} ", Convert.ToUInt16(ch).ToString("X4"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static void Main(string[] args)
Console.WriteLine("There are no command line arguments.");
return;
}
if (! Directory.Exists(args[0])) {
if (!Directory.Exists(args[0])) {
Console.WriteLine("The directory does not exist.");
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void sourceCurrency_TextChanged(object sender, EventArgs e)
// <Snippet2>
public void OKButton_Click(object sender, EventArgs e)
{
if (! String.IsNullOrEmpty(sourceCurrency.Text))
if (!String.IsNullOrEmpty(sourceCurrency.Text))
if (RegexLib.IsValidCurrency(sourceCurrency.Text))
PerformConversion();
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void sourceCurrency_TextChanged(object sender, EventArgs e)

public void OKButton_Click(object sender, EventArgs e)
{
if (! String.IsNullOrEmpty(sourceCurrency.Text))
if (!String.IsNullOrEmpty(sourceCurrency.Text))
if (RegexLib2.IsValidCurrency(sourceCurrency.Text))
PerformConversion();
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// <Snippet5>
using System;
using System.Text.RegularExpressions;
Expand All @@ -10,7 +10,7 @@
string pattern = @"\b\d{1,2}\.\s";
foreach (string item in Regex.Split(input, pattern))
{
if (! String.IsNullOrEmpty(item))
if (!String.IsNullOrEmpty(item))
Console.WriteLine(item);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// <Snippet8>
using System;
using System.Resources;
Expand All @@ -13,7 +13,7 @@
string title = rm.GetString("TableName");
PersonTable tableInfo = (PersonTable) rm.GetObject("Employees");

if (! String.IsNullOrEmpty(title)) {
if (!String.IsNullOrEmpty(title)) {
fmtString = "{0," + ((Console.WindowWidth + title.Length) / 2).ToString() + "}";
Console.WriteLine(fmtString, title);
Console.WriteLine();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// <Snippet9>
using System;
using System.Globalization;
Expand All @@ -19,7 +19,7 @@
Console.WriteLine($"\n{greeting}!");
Console.Write(rm.GetString("Prompt", CultureInfo.CurrentCulture));
string name = Console.ReadLine();
if (! String.IsNullOrEmpty(name))
if (!String.IsNullOrEmpty(name))
Console.WriteLine("{0}, {1}!", greeting, name);
}
Console.WriteLine();
Expand Down
Loading