How ro convert char into string??

Ads
 

How ro convert char into string??

Suppose i have one array like... char [] ch={'H','E','L','L','o'};

now i want to convert this arrar into string using recursive function. Then how can i do it???

View Answers

January 28, 2011 at 12:16 PM

Hi Friend,

Try this:

import java.util.*;
class ConvertCharArrayToString 
{
    public static void main(String[] args) 
    {
        StringBuffer buffer=new StringBuffer();
        char [] ch={'H','E','L','L','O'};
        for(int i=0;i<ch.length;i++){
            buffer.append(ch[i]);
        }
        String str=buffer.toString();
        System.out.println(str);
    }
}

Thanks


January 28, 2011 at 10:43 PM

This coding is for java...but i want this in c#

How ro convert char into string using recursive function in c#?? char [] ch={'H','E','L','L','o'};

TO

ans = HELLO

Ads









Related Tutorials/Questions & Answers:
How ro convert char into string??
How ro convert char into string using recursive function in c#??
Advertisements
Stringop
Convert Hexa To Char
convert char to string objective c
Convert Char To Byte
Conversion from short to char
Conversion from int to char
Conversion from float to char
Conversion from double to char
Conversion from long to char
Conversion from byte to char
Java char to int
Convert Character into a String
Conversion from String to char
how to convert ACSII to HEX
how char values are converted to their 16-bit representation in jvm?
Java char to string
How to convert into to String in Java?
How to Convert ArrayList to Array?
How to convert NSString to NSInteger?
how to get string after first occurence of alphanumeric char in java?
How to Convert String to Date?
How to convert a String to an int?
How to convert String into java.util.Date
how to convert jsp to exe
How to convert XML file to database ?
How to convert string to byte in Java
how to convert sql into hql
Java char to string
how to convert string to image in java

Ads