File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 3275

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
author & internet detective

Joined: May 26, 2003
Posts: 33130

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.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: String concat
It's not a secret anymore!