How do I replace any number of character occurences with one occurrence?


Posted on 16th Feb 2014 07:03 pm by admin

How do I replace any number of character occurences with one occurrence?

Let's say I have:

aaa
aaaaaa
aaaaa
aaaaaaaa

All of the above should be replaces with a single 'z' character say for example

I can do exact matches, say for 'aaaaaa' - but am unsure how I can do for any number

I'm sure it should be possible to do using one line of code - but I'm just not sure where to start!

Thanks

No comments posted yet

Your Answer:

Login to answer
255 Like 38 Dislike
Previous forums Next forums
Other forums

Option box to change variable
Hello, i need help by making a script!

I need to write a file with option box, so a dropdown

Wordpress IE issue
So I am trying to add the background shadow to my wordpress page. It works fine in Firefox but does

Stats of viewers
Hello. I have a website in php and people can login. I want to make an admin control panel where u c

FFmpeg Images 2 Video conversion problem ??
I got folder full of images , number of images = 600 , I want to make a video which plays one image

Multidimensional $_POST
Hello

How to get a single array from array of array (2 - dimension).
For example I have a

bit of help needed
Im about to sort out my registration page for my website by customising a "registration" s

mysql UNION | warning mysql_fetch_array !!
Code: <?php
$i = 0;
$query1="SELECT * FROM `products` WHERE `div

Error Messaging not working
I changed the way my form tells the user of an error. But I can't seem to get it to work properly.

Saas with SAP R/3
hi experts,

Is SaaS offer available in SAP? for SAP R/3? from where i can get the info a

Calculating a rating by adding number of points and dividing by number of items
I have a site that users can post links to files to download. They can rate these files on a 1-5 sca

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash