Jump to content
Sign in to follow this  
cynapse

String Replace Sensitive case

Recommended Posts

cynapse

Hi !

i need some help to write my script :

I have a file with generic strings which contain word <PROJECT> that i'd like to parse with the content of my variable $project

ex : $data = "./start.sh <PROJECT>"

so I use StringReplace($data, "<PROJECT>", $project) and that works.

However, i'd like to parse my string <PROJECT> case-sensitivly.

Exemple : if $data = "./start.sh <Project>" and $project = "ABCDEF", i'd like to have $res = "./start.sh Abcdef" (with the first character in upper mode)

Could you help me please ?

Thanks !

Share this post


Link to post
Share on other sites
Juvigy

Check out this function:

StringReplace ( "string", "searchstring" or start, "replacestring" [, count [, casesense]] )

Share this post


Link to post
Share on other sites
cynapse

already checked out but i haven't found something interested.

Have i forgotten to read something ?

The casesentivie option seems to be useless for me... :D

Share this post


Link to post
Share on other sites
jvanegmond

You must use the _StringProper function on $project, this will turn $project from "ABCDEF" into "Abcdef".

From there you can do a normal StringReplace.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.