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
how to convert string to char array in Java
how to convert string to char array in java without using tochararray
Convert Hexa To Char
Stringop
convert char to string objective c
Convert Char To Byte
Conversion from short to char
ModuleNotFoundError: No module named 'stringen'
ModuleNotFoundError: No module named 'stringly'
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
Convert Character into a String
Java char to int
how to convert ACSII to HEX
Conversion from String to char
how char values are converted to their 16-bit representation in jvm?
How to convert into to String in Java?
ModuleNotFoundError: No module named 'RO'
How to Convert ArrayList to Array?
Java char to string
How to convert NSString to NSInteger?
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 ?

Ads