[PATCH v2 13/20] doc: Clean up the table for string relational operators

eugene.loh
2025-10-22T03:23:27Z

The text referred to "Table 1", which is not otherwise identified. It
included a link using an undefined ID. Scrap both, especially since the
table immediately follows the text anyhow. Clean that up.

Also, the "String Assignment" link was missing its anchor tag. Add one.

While we are at it, for better readability and maintainability of the
source file:

- convert the table from HTML to Markdown

- introduce line breaks into the very long text line

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
---
.../dtrace-ref-DTraceSupportforStrings.md | 73 ++++---------------
1 file changed, 14 insertions(+), 59 deletions(-)

diff --git a/doc/userguide/reference/dtrace-ref-DTraceSupportforStrings.md b/doc/userguide/reference/dtrace-ref-DTraceSupportforStrings.md
index ea44523ed..e9239026f 100644
--- a/doc/userguide/reference/dtrace-ref-DTraceSupportforStrings.md
+++ b/doc/userguide/reference/dtrace-ref-DTraceSupportforStrings.md
@@ -80,65 +80,21 @@ Scalar type expressions, such as a pointer or integer, or a scalar array address

## String Comparison

-D overloads the binary relational operators and permits them to be used for string comparisons, as well as integer comparisons. The relational operators perform string comparison whenever both operands are of type `string` or when one operand is of type `string` and the other operand can be promoted to type `string`. See [String Assignment](dtrace-ref-DTraceSupportforStrings.md) for a detailed description. See also [Table 1](dtrace-ref-DTraceSupportforStrings.md#dt_t14_dlang), which lists the relational operators that can be used to compare strings.
+D overloads the binary relational operators and permits them to be used for string comparisons, as well as integer comparisons.
+The relational operators perform string comparison whenever both operands are of type `string`
+or when one operand is of type `string` and the other operand can be promoted to type `string`.
+See [String Assignment](dtrace-ref-DTraceSupportforStrings.md#dt_strasg_dlang) for a detailed description.
+See also the following table, which lists the relational operators that can be used to compare strings.
+
+| Operator | Description |
+| :--- | :--- |
+| `<` | Left-hand operand is less than right-operand. |
+| `<=` | Left-hand operand is less than or equal to right-hand operand. |
+| `>` | Left-hand operand is greater than right-hand operand. |
+| `>=` | Left-hand operand is greater than or equal to right-hand operand. |
+| `==` | Left-hand operand is equal to right-hand operand. |
+| `!=` | Left-hand operand is not equal to right-hand operand. |

-
-
-Operator
-
-
-
-Description
-
-
-
-`<`
-
-
-
-Left-hand operand is less than right-operand.
-
-
-
-`<=`
-
-
-
-Left-hand operand is less than or equal to right-hand operand.
-
-
-
-`>`
-
-
-
-Left-hand operand is greater than right-hand operand.
-
-
-
-`>=`
-
-
-
-Left-hand operand is greater than or equal to right-hand operand.
-
-
-
-`==`
-
-
-
-Left-hand operand is equal to right-hand operand.
-
-
-
-`!=`
-
-
-
-Left-hand operand is not equal to right-hand operand.
-
-
As with integers, each operator evaluates to a value of type `int`, which is equal to one if the condition is true or zero if it is false.

The relational operators compare the two input strings byte-by-byte, similarly to the C library routine `strcmp()`. Each byte is compared by using its corresponding integer value in the ASCII character set until a null byte is read or the maximum string length is reached. See the `ascii(7)` manual page for more information. Some example D string comparisons and their results are shown in the following table.
@@ -179,4 +135,3 @@ Returns 0 \(false\)
**Note:**

Identical Unicode strings might compare as being different if one or the other of the strings isn't normalized.
-
--
2.47.3