hello friends,

I have s small problem, say if I declare a variable as

String name="miraj";

now i want to use the value of the variable name, that is "miraj" and create a file using that name, which means something like miraj.txt ...

how do I do it? The part that i don't get is the method by which i could extract the part "miraj"??

would really appreciate your help :)

Uhm, what do you mean "extract the part".

To concatenate Strings you use "+" of course. I.E.

string1 + string2

Edited 6 Years Ago by masijade: n/a

Uhm, what do you mean "extract the part".

To concatenate Strings you use "+" of course. I.E.

string1 + string2

well , what i mean is, how can i use the variable value, that is "miraj" in the example that i have pointed out, and use "miraj" to to name a file, that is i want to make a file named miraj.txt

Uhm name + ".txt" , maybe?

Why do you think I showed you how to do String concatenation?
Not as though you are extracting anything though.

Uhm name + ".txt" , maybe?

Why do you think I showed you how to do String concatenation?
Not as though you are extracting anything though.

yeah, I tried it bro, it doesn't work :(

Uhm name + ".txt" , maybe?

Why do you think I showed you how to do String concatenation?
Not as though you are extracting anything though.

oh, my bad ! it does work bro...thanks a million :D

Rule of thumb: if masijade says it, it probably works. I'm just sayin', the guy knows his stuff.
Second rule of thumb: "it doesn't work" is not a useful error report, and will probably get you nothing useful back. Next time, say what you tried, what you expected to happen, and what you saw instead.

Rule of thumb: if masijade says it, it probably works. I'm just sayin', the guy knows his stuff.
Second rule of thumb: "it doesn't work" is not a useful error report, and will probably get you nothing useful back. Next time, say what you tried, what you expected to happen, and what you saw instead.

yes,that's is a very valuable piece of advice :) thanks a lot...I shall keep those points in mind in my future questions...thanks friend.

This article has been dead for over six months. Start a new discussion instead.