Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #59524

Rosetta: Increment a numerical string

From "Robert L." <No_spamming@noWhere_7073.org>
Newsgroups comp.lang.forth
Subject Rosetta: Increment a numerical string
Date 2017-05-19 03:44 +0000
Organization Aioe.org NNTP Server
Message-ID <oflpmm$13v1$1@gioia.aioe.org> (permalink)

Show all headers | View raw


"foo99bar".sub(/\d+/){|s| s.to_i + 1}
    ==>"foo100bar"

"foo99bar".sub(/\d+/){|s| 2**s.to_i }
    ==>"foo633825300114114700748351602688bar"

In Forth?

-- 
Goyim were born only to serve us. Without that, they have no place in the
world---only to serve the People of Israel....  They will work, they will plow,
they will reap. We will sit like an effendi and eat. --- Rabbi Ovadia Yosef
https://web.archive.org/web/20101020044210/http://www.jpost.com/JewishWorld/JewishNews/Article.aspx?id=191782
http://archive.org/download/DavidDuke_videos/TopRabbiExposesJewishRacism-cybsdwjezqi.ogv

Back to comp.lang.forth | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Rosetta: Increment a numerical string "Robert L." <No_spamming@noWhere_7073.org> - 2017-05-19 03:44 +0000
  Re: Rosetta: Increment a numerical string rickman <gnuarm@gmail.com> - 2017-05-19 00:16 -0400
    Re: Rosetta: Increment a numerical string Julian Fondren <julian.fondren@gmail.com> - 2017-05-18 21:47 -0700
      Re: Rosetta: Increment a numerical string rickman <gnuarm@gmail.com> - 2017-05-19 01:24 -0400

csiph-web