Commit 564260b
authored
Update Path.GetDirectoryName Snippet3 (#10853)
the current docs are outdated to NRT and confuse quotes
1. variable should be type string? not string
2. uses old-style format string (new would use interpolated syntax)
3. filepath reassignment should use conditional syntax
4. results suggest using single-quote [i.e. char not string], ugh
5. the final returned result is null but demo output shows '' which is factually visually correct but confusingly indistinuishable from "" emptystring
I propose replacement C# code for this Snippet31 parent 51a7d8e commit 564260b
File tree
1 file changed
+25
-26
lines changed- snippets/csharp/System.IO/Path/ChangeExtension
1 file changed
+25
-26
lines changedLines changed: 25 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
| |||
378 | 377 | | |
379 | 378 | | |
380 | 379 | | |
381 | | - | |
| 380 | + | |
0 commit comments