<commit_before>---
title: isBlank and isEmpty Functions
keywords: query language reference
tags: [reference page]
permalink: ts_isblank.html
summary: Reference to the isBlank() and isEmpty() string manipulation functions
---
## Summary
```
isBlank(<metric|source|PointTag>, <expression>)
isEmpty(<metric|source|PointTag>, <expression>)
```

The isBlank() function returns true if the value of the metric, source, or point tag string is a blank character (`" "`), and returns false otherwise.

The isEmpty() function returns true if the value of the metric, source, or point tag string is the empty string, and returns false otherwise.


## Parameters
<table style="width: 100%;">
<tbody>
<thead>
<tr><th width="20%">Parameter</th><th width="80%">Description</th></tr>
</thead>
<tr>
<td markdown="span">metric|source|pointTag</td>
<td>The metric, source, or point tag for which you want to know whether it corresponds to an empty or blank string.</td></tr><tr>
<td markdown="span"> [expression](query_language_reference.html#expressions)</td>
<td>The expression that contains the metric, source, or point tag.</td></tr>
</tbody>
</table>


## Example

The following example illustrates how `isBlank()` works:

In the screenshot on the left, we use `isBlank()` to see whether the string `"newPointTagValue"` is blank. The query returns false.

`isBlank(service, ${ts})`

In the screenshot on the right, we use `isBlank()` to see whether the string `" "` is blank.

`isBlank(service, ${ts_b})`


Because the string this query uses is the empty string (`" "`), this query returns true.


![ts isBlank](images/ts_isBlank.png)<commit_msg>Image didn't show up, wrong name.<commit_after>---
title: isBlank and isEmpty Functions
keywords: query language reference
tags: [reference page]
permalink: ts_isblank.html
summary: Reference to the isBlank() and isEmpty() string manipulation functions
---
## Summary
```
isBlank(<metric|source|PointTag>, <expression>)
isEmpty(<metric|source|PointTag>, <expression>)
```

The isBlank() function returns true if the value of the metric, source, or point tag string is a blank character (`" "`), and returns false otherwise.

The isEmpty() function returns true if the value of the metric, source, or point tag string is the empty string, and returns false otherwise.


## Parameters
<table style="width: 100%;">
<tbody>
<thead>
<tr><th width="30%">Parameter</th><th width="70%">Description</th></tr>
</thead>
<tr>
<td markdown="span">metric|source|pointTag</td>
<td>The metric, source, or point tag for which you want to know whether it corresponds to an empty or blank string.</td></tr><tr>
<td markdown="span"> [expression](query_language_reference.html#expressions)</td>
<td>The expression that contains the metric, source, or point tag.</td></tr>
</tbody>
</table>


## Example

The following example illustrates how `isBlank()` works:

* In the screenshot on the left, we use `isBlank()` to see whether the string `"newPointTagValue"` is blank. The query returns false.

   `isBlank(service, ${ts})`

* In the screenshot on the right, we use `isBlank()` to see whether the string `" "` is blank.

   `isBlank(service, ${ts_b})`


Because the string this query uses is the empty string (`" "`), this query returns true.


![ts isBlank](images/ts_is_blank.png)
{'fraction_non_alphanumeric': 0.13505311077389984, 'fraction_numerical': 0.004248861911987861, 'mean_word_length': 5.450097847358121, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7114250', 'n_tokens_mistral': 1017, 'n_tokens_neox': 954, 'n_words': 388}