<!--
{
  "documentType" : "article",
  "framework" : "AppleNewsAPI",
  "identifier" : "/documentation/AppleNews/formatting-strings",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Formatting Strings"
}
-->

# Formatting Strings

Learn how to format strings to pass to the API client.

## Discussion

When using command-line utilities to pass a string to the API client, enclose the string in single quotation marks to treat the text literally. When you enclose a string in double quotation marks, you need to escape certain ASCII characters (for example, the $ character).

This example uses single quotation marks:

```other
alert-body='Big Company is acquiring Smaller Company for $2.5 billion.'
```

This example shows the result of using single quotation marks:

```other
"alertBody": "Big Company is acquiring Smaller Company for $2.5 billion."
```

This example uses double quotation marks incorrectly:

```other
alert-body="Big Company is acquiring Smaller Company for $2.5 billion."
```

This example shows the result of using double quotation marks incorrectly. A string in double quotation marks with the $ sign should include an escape character:

```other
"alertBody": "Big Company is acquiring Smaller Company for .5 billion."
```

This example correctly uses double quotation marks with an escape character:

```other
alert-body="Big Company is acquiring Smaller Company for \$2.5 billion."
```

This example shows the result of using double quotation marks with an escape character:

```other
"alertBody": "Big Company is acquiring Smaller Company for $2.5 billion."
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)