topstrrepl
String
Return value
another string
Parameters
str
in
required
arg2
in
required
rchar
in
required
Examples
; Convert one letter into upper case
abc = 'abcdefghijklmnopqrstuvwxyz'
print,strrepl(abc,strpos(abc,'m'),'M')
; prints "abcdefghijklMnopqrstuvwxyz"
; Use with strwhere function
a = 'abcabcabc'
print,strrepl(a,strwhere(a,'a'),'#')
; prints "#bc#bc#bc#bc#bc"
IDL> print, strrepl(a,'bc','!eeee!')
a!eeee!a!eeee!a!eeee!
IDL> print, strrepl(a,'b','0000')
a0000ca0000ca0000
IDL> print, strrepl(a,'toto','0000')
abcabcabc
Version history
Version
$Id: strrepl.pro 192 2006-09-22 09:37:08Z smasson $
History
mgs, 02 Jun 1998: VERSION 1.00
sebastien Masson (smlod@ipsl.jussieu.fr)
Known issues
Restrictions
Known shortcoming: if index is an array, it must contain all
valid elements (only the first entry is checked).
Statistics
McCabe cyclic | 11 |
McCabe essential | 1 |
McCabe modular design | 1 |