Skip to content

Modern String ClipRight

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › String Library › String Library › ClipRight

ClipRight

Removes a number of characters from the end.

Syntax

ClipRight( s, count )

Notes

  • O(n)

Examples

#import "std/strings"
using strings

print ClipRight( "1234567890", 3 )     '' 1234567
print ClipRight( "1234567890", 0 )     '' 1234567890
print ClipRight( "1234567890", 99 )    '' (empty)

'' Dropping a known extension
print ClipRight( "report.txt", 4 )     '' report

Library: String Library
Category: String Library
Documented under: The Functions

Clone this wiki locally