How to convert the string to UPPER case letter in java?
// in java file
public static String convertStringToUpperCase(String str) {
String strValue = "";
if (str == null) {
strValue = "NA";
} else {
strValue = str.trim().toUpperCase();
}
return strValue;
}
// in set & get java file
private String brcode;
public String getBrcode() {
return brcode;
}
public void setBrcode(String brcode) {
this.brcode = javafile.convertStringToUpperCase(brcode);
}
// in java file
public static String convertStringToUpperCase(String str) {
String strValue = "";
if (str == null) {
strValue = "NA";
} else {
strValue = str.trim().toUpperCase();
}
return strValue;
}
// in set & get java file
private String brcode;
public String getBrcode() {
return brcode;
}
public void setBrcode(String brcode) {
this.brcode = javafile.convertStringToUpperCase(brcode);
}
No comments:
Post a Comment