Sign in to follow this  
Followers 0
cynapse

String Replace Sensitive case

4 posts in this topic

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



Check out this function:

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

Share this post


Link to post
Share on other sites

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

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  
Followers 0