This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes String concat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "String concat" Watch "String concat" New topic

String concat

Cindy Martin

Joined: Jul 29, 2008
Posts: 10

I want to concate two strings and compare that string to another one..But i could find that in ANT , the concat is only for the files.

For ex,

Str 1 = "abc"
Str 2 = "cdu"

I want to concat these two and compare that resultant string to another string.

Is there any way to do concat for two strings?

Kindly help,

Martijn Verburg

Joined: Jun 24, 2003
Posts: 3274

Hi Cindy,

Can I ask what String s you are trying to concatenate and what purpose you are using it in the comparison for? I don't _think_ ANT directly supports what you are after but there might be another way around your problem.

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30076

You don't really have Strings in Ant - you have properties. It is possible to do what you want with two properties. Ant does the implicit concat for string properties.

If you have two actual Strings, they are probably in a scripting language like BSH. If this is the case, you could just use the concat operator in that scripting language.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
I agree. Here's the link:
subject: String concat
Similar Threads
How do I convert an object into a string?
Strings and immutability
Please help me
String literal and String object comparison
About Adler 32 checksum