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
4 changes: 4 additions & 0 deletions snippets/csharp/System/String/Replace/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//Example1.Main();
//Example2.Main();
//Example3.Main();
Example4.Main();
8 changes: 8 additions & 0 deletions snippets/csharp/System/String/Replace/Project.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

</Project>
8 changes: 4 additions & 4 deletions snippets/csharp/System/String/Replace/replace1.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System;

public class Example
public class Example1
{
public static void Main()
{
// <Snippet1>
String s = "aaa";
Console.WriteLine("The initial string: '{0}'", s);
string s = "aaa";
Console.WriteLine($"The initial string: '{s}'");
s = s.Replace("a", "b").Replace("b", "c").Replace("c", "d");
Console.WriteLine("The final string: '{0}'", s);
Console.WriteLine($"The final string: '{s}'");

// The example displays the following output:
// The initial string: 'aaa'
Expand Down
8 changes: 4 additions & 4 deletions snippets/csharp/System/String/Replace/replace2.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System;

public class Example
public class Example2
{
public static void Main()
{
// <Snippet2>
String s = new String('a', 3);
Console.WriteLine("The initial string: '{0}'", s);
string s = new('a', 3);
Console.WriteLine($"The initial string: '{s}'");
s = s.Replace('a', 'b').Replace('b', 'c').Replace('c', 'd');
Console.WriteLine("The final string: '{0}'", s);
Console.WriteLine($"The final string: '{s}'");

// The example displays the following output:
// The initial string: 'aaa'
Expand Down
12 changes: 7 additions & 5 deletions snippets/csharp/System/String/Replace/string.replace1.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System;

class stringReplace1 {
public static void Main() {
class Example3
{
public static void Main()
{
//<snippet1>
String str = "1 2 3 4 5 6 7 8 9";
Console.WriteLine("Original string: \"{0}\"", str);
Console.WriteLine("CSV string: \"{0}\"", str.Replace(' ', ','));
string str = "1 2 3 4 5 6 7 8 9";
Console.WriteLine($"Original string: \"{str}\"");
Console.WriteLine($"CSV string: \"{str.Replace(' ', ',')}\"");

// This example produces the following output:
// Original string: "1 2 3 4 5 6 7 8 9"
Expand Down
9 changes: 3 additions & 6 deletions snippets/csharp/System/String/Replace/stringreplace.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
using System;

public class ReplaceTest
public class Example4
{
public static void Main()
{

//<snippet1>
string errString = "This docment uses 3 other docments to docment the docmentation";

Console.WriteLine("The original string is:{0}'{1}'{0}", Environment.NewLine, errString);
Console.WriteLine($"The original string is:{Environment.NewLine}'{errString}'{Environment.NewLine}");

// Correct the spelling of "document".

string correctString = errString.Replace("docment", "document");

Console.WriteLine("After correcting the string, the result is:{0}'{1}'",
Environment.NewLine, correctString);
Console.WriteLine($"After correcting the string, the result is:{Environment.NewLine}'{correctString}'");

// This code example produces the following output:
//
Expand Down
11 changes: 3 additions & 8 deletions xml/System.Buffers.Text/Utf8Parser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,16 @@
</Parameters>
<Docs>
<param name="source">The Utf8 string to parse.</param>
<param name="value">When the method returns, contains the value parsed from <paramref name="source" />, if the parsing operation succeeded. </param>
<param name="value">When the method returns, contains the value parsed from <paramref name="source" />, if the parsing operation succeeded.</param>
<param name="bytesConsumed">If the parsing operation was successful, contains the length in bytes of the parsed substring when the method returns. If the method fails, <paramref name="bytesConsumed" /> is set to 0.</param>
<param name="standardFormat">The expected format of the Utf8 string.</param>
<param name="standardFormat">The expected format of the Utf8 string. Supported formats are <c>'G'</c>, <c>'l'</c>, and <c>default</c>.</param>
<summary>Parses a <see cref="T:System.Boolean" /> at the start of a Utf8 string.</summary>
<returns>
<see langword="true" /> for success; <see langword="false" /> if the string was not syntactically valid or an overflow or underflow occurred.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

Formats supported:

|Format string|Example expected format|
|--|--|
|G (default)|True/False|
|l|true/false|
The parsing is case insensitive. The format parameter is validated to ensure it is supported; however, all supported formats are treated identically.

]]></format>
</remarks>
Expand Down
23 changes: 21 additions & 2 deletions xml/System.Windows/Application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2476,9 +2476,28 @@ This example illustrates how to use XAML together with application-scope resourc
<ReturnType>System.Windows.ThemeMode</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<summary>Gets or sets the Fluent theme mode of the application.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
<remarks>
<para>Setting this property controls if Fluent theme is loaded in Light, Dark or System mode.</para>
<para>It also controls the application of backdrop and darkmode on window.</para>
<para>The four values for the ThemeMode enum are :</para>
<para>
<see cref="P:System.Windows.ThemeMode.None" /> - No Fluent theme is loaded.</para>
<para>
<see cref="P:System.Windows.ThemeMode.System" /> - Fluent theme is loaded based on the system theme.</para>
<para>
<see cref="P:System.Windows.ThemeMode.Light" /> - Fluent theme is loaded in Light mode.</para>
<para>
<see cref="P:System.Windows.ThemeMode.Dark" /> - Fluent theme is loaded in Dark mode.</para>
<para>These values are predefined in <see cref="P:System.Windows.Application.ThemeMode" /> struct The default value is <see cref="P:System.Windows.ThemeMode.None" />.</para>
<para>
<see cref="P:System.Windows.Application.ThemeMode" /> and <see cref="P:System.Windows.Application.Resources" /> are designed to be in sync with each other.</para>
<para>Syncing is done in order to avoid UI inconsistencies, where the window is in dark mode but the controls within are in light mode or vice versa.</para>
<para>Setting this property loads the Fluent theme dictionaries in the application resources.</para>
<para>So, if you set this property, it is preferrable to not include Fluent theme dictionaries in the application resources manually. If you do, the Fluent theme dictionaries added in the application resources will take precedence over the ones added by setting this property.</para>
<para>This property is experimental and may be removed in future versions.</para>
</remarks>
</Docs>
</Member>
<Member MemberName="TryFindResource">
Expand Down
Loading