Search
 
SCRIPT & CODE EXAMPLE
 

PERL

perl replace substring

# For Perl (language) only

# syntax (NOTE: this overwrites your original string)
<variable> =~ s/<substring-to-replace>/<replacing-substring>/g;

# example: replacing all the 'r' characters with 'l'
$YourVar =~ s/r/l/g;

# usable example
my $YourVar = "strawberry";
$YourVar =~ s/r/l/g;
print $YourVar; 
print "
";
Comment

PREVIOUS NEXT
Code Example
Perl :: perl loops 
Perl :: perl regex syntax 
Perl :: perl read file 
Perl :: print a variable perl 
Perl :: perl 
Perl :: perl http request 
Pascal :: take console input in pascal 
Pascal :: pascal exception handling 
Pascal :: pascal online compiler 
Powershell :: windows 10 debloat 
Powershell :: Auto-open DevTools on every new tab For powershell on Windows 
Gdscript :: godot 2d set position to mouse 
Clojure :: ex: Clojure define expected time 
Lisp :: common lisp map number to word 
Assembly :: x86 assembly hello world 
Assembly :: ARM assembly divide by 2 
Assembly :: sort in assembly pcspim 
Javascript :: jquery vslidation remove spaces from input 
Javascript :: list all node processes 
Javascript :: javascript radian to degree 
Javascript :: check react version terminal windows 
Javascript :: jquery only number allowed to 10 digit 
Javascript :: count number of checkboxes in html jquery 
Javascript :: javascript lowercase string 
Javascript :: regex date validation mm/dd/yyyy 
Javascript :: how to console.log formData 
Javascript :: js scroll to id 
Javascript :: sleep for 1 second 
Javascript :: jquery css add important 
Javascript :: dconf-editor install terminal 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =