cynapse Posted September 10, 2009 Share Posted September 10, 2009 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 ! Link to comment Share on other sites More sharing options...
Juvigy Posted September 10, 2009 Share Posted September 10, 2009 Check out this function: StringReplace ( "string", "searchstring" or start, "replacestring" [, count [, casesense]] ) Link to comment Share on other sites More sharing options...
cynapse Posted September 10, 2009 Author Share Posted September 10, 2009 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... Link to comment Share on other sites More sharing options...
jvanegmond Posted September 10, 2009 Share Posted September 10, 2009 You must use the _StringProper function on $project, this will turn $project from "ABCDEF" into "Abcdef". From there you can do a normal StringReplace. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now