FG
💻 Software

Delete the first known character in a string with sed

Fresh5 days ago
Mar 15, 202652674 views
Confidence Score0%
0%

Problem

How does one delete the first known character in a string with sed? For example, say I want to delete the first character (which is @) in the string "@ABCDEFG1234" I want sed to verify whether "@" exists as the first character. If so, it should delete the character.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Delete the first known character in a string with sed

Low Risk

There's no need to capture and replace. This replaces the character when it's first in the string, with nothing. Thus, deleting it.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment