From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: bc Newsgroups: gmane.emacs.help Subject: Re: string-replace question -- changing names like variable_name to variableName Date: Tue, 03 Sep 2002 10:47:40 -0400 Organization: we live to survive our paradoxes. Sender: help-gnu-emacs-admin@gnu.org Message-ID: <3D74CB8C.39FE242D@example.net> References: <3D74B686.1D603DC1@example.net> <3d74c36b.21967808@news.demon.co.uk> Reply-To: bc@example.net NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1031066678 32309 127.0.0.1 (3 Sep 2002 15:24:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 3 Sep 2002 15:24:38 +0000 (UTC) Return-path: Original-Received: from hermes.netfonds.no ([80.91.224.195]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17mFXc-0008Ok-00 for ; Tue, 03 Sep 2002 17:24:32 +0200 Original-Received: from monty-python.gnu.org (monty-python.gnu.org [199.232.76.173]) by hermes.netfonds.no (8.12.1/8.12.1) with ESMTP id g83FQAff003959 for ; Tue, 3 Sep 2002 17:26:10 +0200 (CEST) Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17mFZ7-00043Q-00; Tue, 03 Sep 2002 11:26:05 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.stealth.net!news.stealth.net!nntp5.savvis.net!uunet!dfw.uu.net!an02.austin.ibm.com!ausnews.austin.ibm.com!tivnews!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-NNTP-Posting-Host: bcoley7.raleigh.tivoli.com Original-X-Trace: tivnews.tivoli.com 1031064585 10422 146.84.82.105 (3 Sep 2002 14:49:45 GMT) Original-X-Complaints-To: usenet@tivnews.tivoli.com Original-NNTP-Posting-Date: Tue, 3 Sep 2002 14:49:45 +0000 (UTC) X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en Original-Xref: nntp.stanford.edu gnu.emacs.help:104431 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:996 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:996 John McCabe wrote: > > Try this function: > > (defun get-rid-of-underscore () > (interactive) > (while (re-search-forward "_\\([a-zA-Z]\\)?" nil t) > (replace-match (upcase (match-string 1)) nil nil))) > > on this data: > > hello_aorld > hello_Aorld > hello_borld > hello_Borld > hello_corld > hello_Corld > hello_dorld > hello_Dorld > hello_eorld > hello_Eorld > > Does it work? Works great, and very educational on helping with my lisp programming. Thanks much!