Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Use strings in Mathematica, like in C?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61373] Re: Use strings in Mathematica, like in C?
  • From: "dkr" <dkrjeg at adelphia.net>
  • Date: Mon, 17 Oct 2005 02:29:39 -0400 (EDT)
  • References: <disllm$mj5$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

changeChar replaces the nth character of str with newChar

In[11]:=
changeChar[str_String,n_Integer,newChar_String]:=
    StringReplacePart[str,newChar,{n,n}];
In[12]:=
egString="abcdefg";
changeChar[egString,4,"h"]//InputForm
Out[13]//InputForm=
"abchefg"


  • Prev by Date: Re: Solving Diophantine Equations
  • Next by Date: Re: Language vs. Library
  • Previous by thread: Re: Use strings in Mathematica, like in C?
  • Next by thread: Re: Use strings in Mathematica, like in C?