Contact

Text · cross-software comparison

TRIM leading spaces without damaging identifiers

Clean ordinary leading/trailing spaces, understand limits around repeated internal spaces and nonbreaking-space characters.

Task

Apply TRIM to three regular spaces, followed by Alpha, followed by three regular spaces.

Expected output

Alpha

Compatibility trap: A plain-space trim does not establish that nonbreaking spaces, tabs or every repeated internal space are handled identically.

One shared five-row test dataset

The same source rows make results easier to compare. Use the CSV in any supported spreadsheet application; the ODS workbook also includes LibreOffice formula tests.

Shared formula comparison fixture (columns A through F)
Region (A)Status (B)Amount (C)SKU (D)Label (E)Units (F)
NorthOpen125SKU-101Alpha2
SouthClosed80SKU-102Beta1
NorthOpen75SKU-103Gamma3
NorthClosed50SKU-104Delta4
SouthOpen200SKU-105Epsilon1

Formula syntax and feature differences

“Documented” rows cite official product help, but were not run in the destination software. A formula shown here is a migration candidate, not a guarantee of identical behaviour or file interoperability.

Formulas can be selected and copied manually. Copy buttons become available when JavaScript is ready.

ONLYOFFICE Spreadsheet Editor

Documented

Version: Current ONLYOFFICE help.

Arguments: TRIM(text)

=TRIM("   Alpha   ")

Documentation explicitly covers leading and trailing spaces; it does not establish all Unicode-space edge cases.

Official documentation ↗

Microsoft Excel

Documented

Version: Classic Excel versions.

Arguments: TRIM(text)

=TRIM("   Alpha   ")

TRIM does not remove nonbreaking spaces by itself.

Important: Vendor help checked; example not executed in this program.

Official documentation ↗

Google Sheets

Documented

Version: Documented in Google Sheets online function help; original introduction and exact release/build not established.

Arguments: TRIM(text)

=TRIM("   Alpha   ")

TRIM does not remove nonbreaking spaces by itself.

Important: Vendor help checked; example not executed in this program.

Official documentation ↗

WPS Spreadsheet

Not researched

Version: Specific version and deployment must be established

This product is listed for future comparison research; no verified formula or feature parity is asserted.

Alternative: Read the vendor help and test against the shared fixture before migrating.

Important: Not tested or verified for this function.

Collabora Office Calc

Not researched

Version: Specific version and deployment must be established

This product is listed for future comparison research; no verified formula or feature parity is asserted.

Alternative: Read the vendor help and test against the shared fixture before migrating.

Important: Not tested or verified for this function.

What changes when you migrate?

The example uses ordinary ASCII space characters and the independent expected output Alpha. That does not test cells containing nonbreaking spaces (U+00A0).

A safer cleanup pipeline for imported CSV data inspects whitespace character codes before changing SKU or postal-code-like text.

Do not use TRIM as a universal text-normalization promise; users should confirm the destination application’s interpretation.

One safe example, then a harder real-world problem

The example input has three ordinary space characters before and after the text Alpha. Removing that padding produces Alpha. This is the independently reasoned target for the TRIM formula candidates, not a claim that every supported application was used to execute this exact expression.

Now imagine you imported SKU- 00123 from CSV. Blindly “cleaning all spaces” could alter a legitimate identifier. The right cleanup depends on whether the whitespace is padding, a significant separator, or a non-standard character. For postal codes, invoice codes and product IDs, preserving meaningful spacing can be essential.

Important distinction: nonbreaking spaces

A nonbreaking space looks similar to an ordinary U+0020 space but is a different character (U+00A0). A function named TRIM in two programs is not enough evidence that both remove U+00A0, tabs or every Unicode whitespace class. Likewise, collapsing multiple internal spaces is not a universal guarantee based on a source that mentions only leading/trailing spaces.

An advanced workflow first inspects the text to determine which character is present, then performs a deliberate SUBSTITUTE operation if required. Avoid normalizing an entire column until you’ve checked the source data and validated the effect on identifiers.

Troubleshooting steps

  1. Type Alpha directly into one cell and run TRIM in the destination program.
  2. Verify the visible result is Alpha, then compare length and character codes where possible.
  3. Paste a string containing a nonbreaking space and record the result separately; do not assume it will match step 2.
  4. Test whether two internal spaces are collapsed, preserved or reported differently.
  5. Confirm that numbers that look like strings (e.g., 00123) remain text throughout CSV import, cleaning and export.

Continue with CSV and text-import guides if the problem began during data import.

Documentation and testing disclosure

Official vendor sources and version scopes appear beside each software candidate above. Expected outputs are independently reasoned from the shared sample; the five new comparisons do not claim native execution in any of the eight applications. Read more about how we distinguish documentation from execution in our editorial standards.

Evidence standard: Only LibreOffice rows labelled “Native tested” were run as executable fixtures. Other entries reflect vendor help or a separately labelled workaround. Dates and versions are shown when known. Last editorial research: 2026-10-11.

← Back to all comparisons