Format examples
Stay organized with collections
Save and categorize content based on your preferences.
To introduce an example in a sentence, use the guidance in the following table:
Guidance |
Recommended |
Not recommended |
At the end of a sentence, use a comma or an em dash. |
Enter a name for the instance, such as my-instance-99 .
Enter a name for the instance—for example, my-instance-99 .
|
Enter a name for the instance, for example, my-instance-99 .
Enter a name for the instance; for example, my-instance-99 .
Enter a name for the instance (for example, my-instance-99 ).
|
In the middle of a sentence, use parentheses if the example is short. Otherwise, rewrite
the sentence. |
Enter a six-digit hex number (for example, 228B22 ), and then click OK.
Enter a six-digit hex number, such as 228B22 , and then click
OK.
Enter a six-digit hex number, and then click OK. For example, if you want the color forest
green, enter 228B22 .
|
Enter a six-digit hex number (for example, if you want the color forest green, enter
228B22 ), and then click OK. |
For more information, see
Parentheses.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-15 UTC.
[null,null,["Last updated 2024-10-15 UTC."],[[["\u003cp\u003eWhen introducing an example at the end of a sentence, use a comma or an em dash before the example.\u003c/p\u003e\n"],["\u003cp\u003eWhen introducing a short example in the middle of a sentence, use parentheses to enclose the example.\u003c/p\u003e\n"],["\u003cp\u003eFor longer examples in the middle of a sentence, it's recommended to rewrite the sentence for better clarity, potentially placing the example at the end.\u003c/p\u003e\n"],["\u003cp\u003eAvoid using phrases like "for example" or semicolons before introducing examples within sentences.\u003c/p\u003e\n"]]],["When inserting an example at the end of a sentence, use a comma or em dash, such as `my-instance-99`. In mid-sentence, short examples should be in parentheses, like `228B22`. Longer mid-sentence examples should be reworded for clarity, rather than inserting the example in the parentheses. Avoid using phrases like \"for example\" when introducing the examples at the end of the sentence.\n"],null,["# Format examples\n\nTo introduce an example in a sentence, use the guidance in the following table:\n\n| Guidance | Recommended | Not recommended |\n|--------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| At the end of a sentence, use a comma or an em dash. | Enter a name for the instance, such as `my-instance-99`. Enter a name for the instance---for example, `my-instance-99`. | Enter a name for the instance, for example, `my-instance-99`. Enter a name for the instance; for example, `my-instance-99`. Enter a name for the instance (for example, `my-instance-99`). |\n| In the middle of a sentence, use parentheses if the example is short. Otherwise, rewrite the sentence. | Enter a six-digit hex number (for example, `228B22`), and then click **OK**. Enter a six-digit hex number, such as `228B22`, and then click **OK**. Enter a six-digit hex number, and then click **OK** . For example, if you want the color forest green, enter `228B22`. | Enter a six-digit hex number (for example, if you want the color forest green, enter `228B22`), and then click **OK**. |\n\nFor more information, see\n[Parentheses](/style/parentheses)."]]