ibm-cloud-sdk-core
Version:
Core functionality to support SDKs generated with IBM's OpenAPI SDK Generator.
72 lines (34 loc) • 868 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [ibm-cloud-sdk-core](./ibm-cloud-sdk-core.md) > [removeSuffix](./ibm-cloud-sdk-core.removesuffix.md)
## removeSuffix() function
Removes a given suffix if it exists.
**Signature:**
```typescript
export declare function removeSuffix(str: string, suffix: string): string;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
str
</td><td>
string
</td><td>
the base string to operate on
</td></tr>
<tr><td>
suffix
</td><td>
string
</td><td>
the suffix to remove, if present
</td></tr>
</tbody></table>
**Returns:**
string
the substring of "str" that remains after the suffix is removed