bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] Is there a way to change a string inplace by index?


From: arnold
Subject: Re: [bug-gawk] Is there a way to change a string inplace by index?
Date: Sun, 04 Sep 2016 04:07:10 -0600
User-agent: Heirloom mailx 12.4 7/29/08

Peng Yu <address@hidden> wrote:

> Hi, I don't find a way to replace some characters of a string inplace
> by index. For example, I want to replace the i-th character of s by x.
> Is there a way to do so in awk?

No, there is no way to do that in awk or gawk. You can write
an awk function to build the new string for you or an extension
function for gawk.  As Davd pointed out there are sub and gsub but those
are regexp based.

Arnold



reply via email to

[Prev in Thread] Current Thread [Next in Thread]