Important Character into string vaariable

Important Character into string vaariable

How to store the character variable into string format?

View Answers

April 28, 2008 at 7:13 PM

Hi friend,

import java.io.*;
import java.lang.*;
public class nativeMethods{
public static void main(String args[]){

String prabhu = "MY NAME IS BAADSHAH KHAN";
String str1 = "He Prabhu";
char[] str2 = new char[34];
System.out.println("Length of string prabhu :" + prabhu.length());
System.out.println("character at third position :" + prabhu.charAt(3));

str1.getChars(0, str1.length(), str2, 0) ;
char a = prabhu.charAt(0);
char b = prabhu.charAt(1);
char c = prabhu.charAt(2);
char d = prabhu.charAt(3);
char e = prabhu.charAt(4);
char f = prabhu.charAt(5);
char g = prabhu.charAt(6);
char h = prabhu.charAt(7);
char i = prabhu.charAt(8);
char j = prabhu.charAt(9);
char k = prabhu.charAt(10);
char l = prabhu.charAt(11);
char m = prabhu.charAt(12);
char n = prabhu.charAt(13);
char o = prabhu.charAt(14);
char p = prabhu.charAt(15);
char q = prabhu.charAt(16);
char r = prabhu.charAt(17);
char s = prabhu.charAt(18);
char t = prabhu.charAt(19);
char u = prabhu.charAt(20);

char upper = Character.toLowerCase(a);
char upper1 = Character.toLowerCase(b);
char upper2 = Character.toLowerCase(c);
char upper3 = Character.toLowerCase(d);
char upper4 = Character.toLowerCase(e);
char upper5 = Character.toLowerCase(f);
char upper6 = Character.toLowerCase(g);
char upper7 = Character.toLowerCase(h);
char upper8 = Character.toLowerCase(i);
char upper9 = Character.toLowerCase(j);
char upper10 = Character.toLowerCase(k);
char upper11 = Character.toLowerCase(l);
char upper12 = Character.toLowerCase(m);
char upper13 = Character.toLowerCase(n);
char upper14 = Character.toLowerCase(o);
char upper15 = Character.toLowerCase(p);
char upper16 = Character.toLowerCase(q);
char upper17 = Character.toLowerCase(r);
char upper18 = Character.toLowerCase(s);
char upper19 = Character.toLowerCase(t);
char upper20 = Character.toLowerCase(u);


System.out.print(upper);
System.out.print(upper1);
System.out.print(upper2);
System.out.print(upper3);
System.out.print(upper4);
System.out.print(upper5);
System.out.print(upper6);
System.out.print(upper7);
System.out.print(upper8);
System.out.print(upper9);
System.out.print(upper10);
System.out.print(upper11);
System.out.print(upper12);
System.out.print(upper13);
System.out.print(upper14);
System.out.print(upper15);
System.out.print(upper16);
System.out.print(upper17);
System.out.println(upper18);
System.out.println(str1.length());
System.out.println(str2);

}
}

April 28, 2008 at 7:15 PM

import java.io.*;
import java.lang.*;
public class don{
public static void main(String args[]){

String prabhu = "my name is baadshah khan";
String str1 = "He Prabhu";
char[] str2 = new char[34];
System.out.println("Length of string prabhu :" + prabhu.length());
System.out.println("character at third position :" + prabhu.charAt(3));

str1.getChars(0, str1.length(), str2, 0) ;
char a = prabhu.charAt(0);
char b = prabhu.charAt(1);
char c = prabhu.charAt(2);
char d = prabhu.charAt(3);
char e = prabhu.charAt(4);
char f = prabhu.charAt(5);
char g = prabhu.charAt(6);
char h = prabhu.charAt(7);
char i = prabhu.charAt(8);
char j = prabhu.charAt(9);
char k = prabhu.charAt(10);
char l = prabhu.charAt(11);
char m = prabhu.charAt(12);
char n = prabhu.charAt(13);
char o = prabhu.charAt(14);
char p = prabhu.charAt(15);
char q = prabhu.charAt(16);
char r = prabhu.charAt(17);
char s = prabhu.charAt(18);
char t = prabhu.charAt(19);
char u = prabhu.charAt(20);






char upper = Character.toUpperCase(a);
char upper1 = Character.toUpperCase(b);
char upper2 = Character.toUpperCase(c);
char upper3 = Character.toUpperCase(d);
char upper4 = Character.toUpperCase(e);
char upper5 = Character.toUpperCase(f);
char upper6 = Character.toUpperCase(g);
char upper7 = Character.toUpperCase(h);
char upper8 = Character.toUpperCase(i);
char upper9 = Character.toUpperCase(j);
char upper10 = Character.toUpperCase(k);;
char upper11 = Character.toUpperCase(l);
char upper12 = Character.toUpperCase(m);
char upper13 = Character.toUpperCase(n);
char upper14 = Character.toUpperCase(o);
char upper15 = Character.toUpperCase(p);
char upper16 = Character.toUpperCase(q);
char upper17 = Character.toUpperCase(r);
char upper18 = Character.toUpperCase(s);
char upper19 = Character.toUpperCase(t);
char upper20 = Character.toUpperCase(u);


System.out.print(upper);
System.out.print(upper1);
System.out.print(upper2);
System.out.print(upper3);
System.out.print(upper4);
System.out.print(upper5);
System.out.print(upper6);
System.out.print(upper7);
System.out.print(upper8);
System.out.print(upper9);
System.out.print(upper10);
System.out.print(upper11);
System.out.print(upper12);
System.out.print(upper13);
System.out.print(upper14);
System.out.print(upper15);
System.out.print(upper16);
System.out.print(upper17);
System.out.println(upper18);
System.out.println(str1.length());
System.out.println(str2);

}
}


------------------------------

read for more information,

http://www.roseindia.net/java/









Related Tutorials/Questions & Answers:
How to display string or character
How to display string or character  how to print character or a word without using array concept
Removing character from a string in sql.
Removing character from a string in sql.  How to remove or replace character from a string
Advertisements
Replace Character in String
Replace Character in String        This example replaces a character with a specified character in a given string. To replace a character with the given character in sting first
J2ME count character into string
J2ME count character into string  i am new in J2ME, my problem is how to count character into number, i had been research google for almost 2 days... form which allow user to input character user input helloworld then press
Removing character from a string in sql.
Removing character from a string in sql.  Removing special characters from a string in sql
count the repeated character in one string
count the repeated character in one string  to find the how character occurrence in one String (for example the string is -java means there is 2... java.util.*; class CountCharacters { public static void main(String[] args) throws
Get Character from String
Get Character from String       In this example we will see that how to convert string to array... toCharArray() to convert string to character array. 3. Retrieve character from
Java Remove a character from string
Java Remove a character from string In this tutorial, you will learn how to remove a character from the string. There are several methods for examining... to remove a particular character from the string. In the given example, we have
Convert string into character array
Description: This tutorial demonstrate how to convert a string into array of char. The toCharArray() method converts string to a new character array...;{   public static void main(String[] args) {  
Find Character form String example
in Action Script3:- String maintain a index position for every character in the string. The first character index position is 0.  String provide charAt() method to find out the character in the string with the help of index position
find all unique character in string using java
find all unique character in string using java  example: hello how are you. output should be waryu
Determining the Character Boundaries in a Unicode String
Determining the Character Boundaries in a Unicode String In this section,  you will learn how to determine the character boundaries in a string. By determining the character boundaries, you will be able to break the string
PHP get character from String
PHP Get Character From String To get sub string from a String we can use substr() method. Structure of this method is :ADS_TO_REPLACE_1 string substr (string $var, int $initial [, int $len]  ) In the above example we want
how to split string after first occurrence of alphanumeric character?
how to split string after first occurrence of alphanumeric character?  String strArray="135(i),15a,14(g)(q)12,67dd(),kk,159";//splited by ',' divide string after first occurrence of alphanumeric value/character expected output
Write a method which will remove any given character from a string?
Write a method which will remove any given character from a string? In this example we will describe remove any given character from a string... argument. It checks the character you want to remove in the string in a sequence
Convert Character into a String
Convert Character into a String   ... the functionality to convert a character into a string.  Code Description:ADS... it into a string format using by the toString() method. This method converts the character
plz give me program to this: Given a string and a number ‘n’, find the ‘n’th distinct repeating character.
plz give me program to this: Given a string and a number ?n?, find the ?n?th distinct repeating character.    Given a string and a number ?n?, find the ?n?th distinct repeating character. For example, Input: Abracadabra, 1
2. Given a string and a number ‘n’, find the ‘n’th distinct repeating character.
2. Given a string and a number ?n?, find the ?n?th distinct repeating character.    Given a string and a number ?n?, find the ?n?th distinct repeating character. For example, Input: Abracadabra, 1 Abracadabra, 2 Abracadabra, 3
In data structure in java how to parse the given string and counts the member of character that match the given data?
In data structure in java how to parse the given string and counts the member of character that match the given data?  Design a parser that parse the given string and counts the member of character that match the given data.using
Write a java program that encrypt and decrypt some string by adding or removing 2 on each character.
Write a java program that encrypt and decrypt some string by adding or removing 2 on each character.  Write a java program that encrypt and decrypt some string by adding or removing 2 on each character. Example 1 : Please Enter
Split string after each character using regular expression
Split string after each character using regular expression... to split the String after each character using expression. For this we are going... SplittingFind.java are described below: String regex = ("\\w.+"):- Creating
String Determining a Character's Unicode Block
String Determining a Character's Unicode Block   ... explanation about the UnicodeBlock() method of String class. We are going to use UnicodeBlock() method of String class in Java. The description of the code is given
String
String  write down the code of remove any character from a given string without using any string function   please give me the code of remove any given character from a given string without using function
string
and a character. It then count the occurrence of that character in the string and display...string  How to count a particular character in a given sentence and also displaying that contain word? Like I want to find "a" in the string
How to convert entity character to html character
How to convert entity character to html character  Please help me to "convert entity character to html character" in java. If possible please provide source code which take String as input and return as String
string
() ) { String token = st.nextToken(); Character ch=Character.valueOf(token.charAt...string  a java program to input a string and display the string with the first character of every word in capital   import java.util.
Find number of words begin with the specified character
character from the string. To do this, we have allowed the user to input a sentence or a string and a character to search. Using StringTokenizer class, we have break down the string into tokens and matches the first character of every token
Count Characters from the input string Java
Count Characters from the input string of Java In this section, you will learn how to count the occurrence of each character in the string. For this, we have..._TO_REPLACE_1 Please enter string Hello World Character
Read a string and reverse it and then print in alphabetical order.
Read a string and reverse it and then print in alphabetical order.       A string is a contiguous sequence of symbols or values, such as a character string (a sequence
string
string  read a sentence and replacing character with immediate preeceding character ex: input:Be careful output:Ad bzqdetk
String indexOf method example
.style1 { font-size: medium; } String indexOf() method example:- String class method indexOf() is use to find the starting character position of the substring from the string. The indexOf() method start to search from
String fromCharCode() method example in Action Script3
.style1 { font-size: medium; } String fromCharCode() method example in Action Script3:- String provide a method to find characters by the character...;200" height="250" title="String form character
Determining the type of Character
Determining the type of Character In this section, you will learn how to determine the type of a character. You can use the methods of Character class to determine the properties of a character. This class provides several methods
character as command line arguments
character as command line arguments  public class testing { public static void main(String args[]) { char a; a=args[0]; System.out.println("character is:"+a); } } what will be the above program output
important
important
Important Question
Important Question  Respected Sir, I am Sanjay Baniwal working in BHEL as a Software Developer as a trainee for One Year. And i have been given a Project in which i have to create a JSP page with a Drop Down List in which all
Character Class
Character Class  Character defines the forDigit();,digit()methods..how can these b used and wht is radix point signifies here...in the arguments of these two???..pls answer a code on this with radix .. are these methods also
STRING.....
STRING.....  plzz sent me d code for counting vowels in a string... gui programme
string
string   difference detween "public static void main (String[] args) " and "public static void main (String args[])" in java but it executes both... "String args[]" can mean a "string array called args which is an array
string
string  String helloString = new String(helloArray); System.out.println(helloString); i am unable to understand this. could u plz explain
string
string  a java program using string function to input any string... ArrangeStringAlphabetically { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.print("Enter string
String
String  how to add spaces with string functions.?   Hi... { public static String addSpaceToRight(String s, int n) { return String.format("%1$-" + n + "s", s); } public static String addSpaceToLeft(String s, int n
String
characters in string?   import java.util.*; class RemoveDuplicateCharatcersFromString { public static String removeDuplicates(String s... < s.length(); i++) { String st = s.substring(i, i + 1
Important - Java Beginners
Important Character into string vaariable  How to store the character variable into string format?  Hi friend,import java.io.*;import... of string prabhu :" + prabhu.length()); System.out.println("character
underscore as character
underscore as character  how can i consider _ as a character instead of wildcard character? my problem is like this i have 20 records as follows manohar 1234455 manohar 453635 manohar 345454 manohar_1234455 now when i am
Character class
Character class   Character defines the forDigit();,digit()methods..how can these b used and wht does radix point signify here.i want to knw what basically radix is??here in the arguments of these two???because i tried runnin
string
*; class ExtractWords { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.print("Enter String: "); String st=input.nextLine(); String str[]=st.split
string
string   just i want to a program in a short form to the given string in buffered reader for example input string: Suresh Chandra Gupta output: S. C...; public class StringTest { public static void main(String [] args
Array of String using Pointers
of string using pointers in C. The declaration of an array of character pointers is an extremely useful extension to single string pointer declarations... Array of String using Pointers   

Ads