help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: string-replace question -- changing names like variable_name to


From: bc
Subject: Re: string-replace question -- changing names like variable_name to variableName
Date: Tue, 03 Sep 2002 10:47:40 -0400

John McCabe wrote:
> 
<snip>
> 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!


reply via email to

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