---
title: "HSTRLEN"
url: "https://docs.yugabyte.com/stable/yedis/api/hstrlen/"
---

# HSTRLEN

## Synopsis

**`HSTRLEN key field`**

This command seeks the length of a string value that is associated with the given `field` in a hash table that is associated with the given `key`.

- If the `key` or `field` does not exist, 0 is returned.
- If the `key` is associated with a non-hash-table value, an error is raised.

## Return value

Returns the length of the specified string.

## Examples

```sh
$ HMSET yugahash L1 America L2 Europe
```

```
"OK"
```

```sh
$ HSTRLEN yugahash L1
```

```
7
```

## See also

[`hdel`](/stable/yedis/api/hdel/ "hdel"), [`hexists`](/stable/yedis/api/hexists/ "hexists"), [`hget`](/stable/yedis/api/hget/ "hget"), [`hgetall`](/stable/yedis/api/hgetall/ "hgetall"), [`hkeys`](/stable/yedis/api/hkeys/ "hkeys"), [`hlen`](/stable/yedis/api/hlen/ "hlen"), [`hmget`](/stable/yedis/api/hmget/ "hmget"), [`hmset`](/stable/yedis/api/hmset/ "hmset"), [`hset`](/stable/yedis/api/hset/ "hset"), [`hincrby`](/stable/yedis/api/hincrby/ "hincrby"), [`hvals`](/stable/yedis/api/hvals/ "hvals")
