# soundex() function

The soundex() function returns the 4-digit `soundex`
 code for a phonetic string expression.

## Syntax

```
soundex(str.exp{,code})
```

## Parameter(s)

| str.exp | Specifies the phonetic string expression from which the 4-digit soundex code is returned. |
| --- | --- |
| code | Provides backward compatibility. Options are: |
| 0 | Original census soundex (default). |
| 1 | English-language soundex. |

## Description

The code consists of the first letter of the word, plus values for the next three additional
 consonants. If there are less than three consonants, 0s are placed in the code.

 The codes are values given to consonants. Words with a similar arrangement of consonants have
 similar codes, regardless of the actual spelling. Also, similar sounding consonants can have the
 same code.

## Example(s)

This outputs `"P220"`.

```
crt soundex("PICK")
```

## See also

- [BASIC functions](https://d3codex.com/pickbasic-flashbasic/basic-functions/)
- [Statements and functions](https://d3codex.com/pickbasic-flashbasic/statements-and-functions/)
- [u00b9 user exit](https://d3codex.com/pickbasic-flashbasic/u00b9-user-exit/)

---
Source: https://d3codex.com/pickbasic-flashbasic/soundex-function/ - part of the D3Codex reference.
