How to convert a string from lower case to upper case withour using transla
Hi all,
how to convert a string from lower case to upper case withour using translate,
Thanks in Advance,
Reddy
Refer to this related thread
Re: hi guys this very urgent please help
Similar Messages
-
How to convert a string from upper case to lower case in FOX formula
Hi Experts,
How to convert a string from upper case to lower case in FOX formula?
Thanks,
Cheers!!!
PANKAJThe last result.append( c ) should be:
result.append( Character.toLowerCase(c) ); -
How to convert a String into a date in yyyy-MM-dd using SimpleDateFormat?
Hi Guys,
I am using the following code
import java.text.ParseException;
import java.text.SimpleDateFormat;
public class ValiDATE {
private static boolean validateDateFormat(String strDate) {
try {
SimpleDateFormat formatter = new SimpleDateFormat("yy-MM-dd");
try {
formatter.setLenient(false);
formatter.parse(strDate);
catch (ParseException e) {
// invalid date/datetime format
return false;
catch (Exception ignored) {
return true;
public static void main(String args[]){
System.out.println(validateDateFormat("11111-11-11"));
}In the above snippet even if I pass the string parameter as "11111-11-11" it returns a new date and hence prints TRUE in the console, but I want the date to be in yyyy-MM-dd format that is no of years shouldn't exceed 4 digits in all.
I don't want to use RegEx, I know this can be done using SimpleDateFormat, but would like to know how that can be done.
I think it has to do something with this . ( [http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html#year|http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html#year] )
Regards
ARJava.slogger wrote:
Yeah I have gone through the javaDoc and it says For formatting, if the number of pattern letters is 2, the year is truncated to 2 digits; otherwise it is interpreted as a number. The important part is:
JavaDoc:
Any other numeric string, such as a one digit string, a three or more digit string, or a two digit string that isn't all digits (for example, "-1"), is interpreted literally.
Do you know any workarounds else is using a Regex is the best approach?I don't see this as a problem. Everything behaves as designed and as is sensible.
So if you want to avoid dates with 5-digit numbers, I'd add something like:
if (parsedDate.after(CUTOFF_DATE)) {
throw new OhNoesThisIsEvilException("!");
} -
How to translate the key words in ABAp program from lower case to upper cas
How to translate the key words in ABAp program from lower case to upper case?
Hi Kittu,
You need to set the Pretty Printer settings to achieve key words in ABAP program from lower case to upper case.
Utilities -> Settings -> Pretty Printer (tab) -> Select third radio button.
Thats all.
<b>Reward points if this helps.
Manish</b> -
Help! How to convert an instance from java.lang.Object to a particula class
* How to convert an instance from java.lang.Object class to a particular class
witch is known only at the running time?
Roster EJB component is make up of RosterHome, Roster and RosterBean.
RosterHome is the home interface of Roster EJB.
Roster is the remote interface of Roster EJB.
RosterBean is the implement of Roster EJB.
The following code segment is to invoke Roster EJB component.
String jndiName="roster.RosterHome";
javax.naming.Context initial = getInitialContext();//getInitialContext() returns a instance of Context.
Object objref = initial.lookup(jndiName);
RosterHome home =
(RosterHome)javax.rmi.PortableRemoteObject.narrow(objref,
RosterHome.class);
Roster myRoster = home.create();
String team="T1"
String player="Tom"
myRoster.addPlayer(player,team);
But, now, all the home interface, the remote interface and the JNDI Name of
Roster EJB component are not been known at the compiling time. However They are
known at the running time, throught reading from the XML config file.
Questions:
1,How to write code for this case ? or
2,How to convert an instance from Object class to a particular class witch is known
only at the running time?
String jndiName="roster.RosterHome";// in fact, reads from XML file.
String homeClassName="roster.RosterHome";// in fact, reads from XML file.
String remoteClassName="roster.Roster";// in fact, reads from XML file.
javax.naming.Context initial = getInitialContext();//getInitialContext() returns a instance of Context.
Object objref = initial.lookup(jndiName);
Object objHome= javax.rmi.PortableRemoteObject.narrow(objref,
Class.forName(homeClassName));
/* how to do next?
}I am not sure what you are trying to do. But at some point you should know which methods to call on the remote interfaces. Maybe the method names are stored in the XML file as well or you have a set of standard method names (also consider parameters).
However, this can be solved by reflection. Look at the java.lang.reflect package, especially java.lang.reflect.Method, and also at java.lang.Class.
If you are doing this on the app server:
I've seen posts where people say that reflection is not permitted in EJB, but I don't think so. Check the EJB spec.
If you are doing this in an application: reflection is always permitted. Probably also in applets and JSP. -
Looking for a simple way to convert a string to title case
New to LiveCycle and Javascript. Looking for a simple way to convert a string to title case, except acronyms. Currently using the the following, it converts acronyms to lower case:
var str = this.rawValue;
var upCase = str.split(" ");
for(i=0; i < upCase.length; i++) {
upCase[i] = upCase[i].substr(0,1).toUpperCase() + upCase[i].substr(1).toLowerCase();
this.rawValue = upCase.join(' ');Thanks for the reply.
Found the following script in a forum, which works fine as a "custom validation script" in the.pdf version of my form. However, it will not work in LiveCycle? The problem seems to be with
"return str.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g"
function toTitleCase(str) {
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
return str.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function(match, index, title){
if (index > 0 && index + match.length !== title.length &&
match.search(smallWords) > -1 && title.charAt(index - 2) !== ":" &&
(title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') &&
title.charAt(index - 1).search(/[^\s-]/) < 0) {
return match.toLowerCase();
if (match.substr(1).search(/[A-Z]|\../) > -1) {
return match;
return match.charAt(0).toUpperCase() + match.substr(1);
event.value = toTitleCase(event.value); -
How to convert a string value to date
Dear All,
I am new to powershell script, i was trying to store a Ad user password set date to a variable add, add a number of days to get the expire date.
but when i try to convert the variable to date value, I am getting the error as below.
Please help me......
PS C:\script> $passwordSetDate = (get-aduser user1 -properties * | select PasswordLastSet)
PS C:\script> $passwordSetDate
PasswordLastSet
7/15/2014 8:17:24 PM
PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
Cannot find an overload for "ParseExact" and the argument count: "3".
At line:1 char:1
+ $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)Dear All,
I am new to powershell script, i was trying to store a Ad user password set date to a variable add, add a number of days to get the expire date.
but when i try to convert the variable to date value, I am getting the error as below.
Please help me......
PS C:\script> $passwordSetDate = (get-aduser user1 -properties * | select PasswordLastSet)
PS C:\script> $passwordSetDate
PasswordLastSet
7/15/2014 8:17:24 PM
PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
Cannot find an overload for "ParseExact" and the argument count: "3".
At line:1 char:1
+ $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
In your post you ask how to convert a string value to a date. The value returned from the Get-AdUser is already a date. It does not need to be converted.
Bill has sshown one way to convert a date to a string and there are other methods. You need to clarify your question.
If you are really trying ot convert strings to dates then you can start with this:
[datetime]'01/21/1965 13:33:23'
Most date strings aer autodetected by the class.
¯\_(ツ)_/¯ -
How to convert a String("yyyy-mm-dd") to the same but in Date format ?
Hi,
can anyone plz tell me how to convert a String to a date format.I'm using MSACCESS database.I want to store this string in the database.So i need to convert it to a date format since the table is designed such a way with date/time type for date field.I used SimpleDateFormat ,but i can't able to convert.The code is given below:
coding:
public String dateconvertion(String strDate)
try
SimpleDateFormat sdfSource = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdfSource.parse(strDate);
SimpleDateFormat sdfDestination = new SimpleDateFormat("yyyy-MM-dd ");
strDate = sdfDestination.format(date);
catch(ParseException pe)
System.out.println("Parse Exception : " + pe);
return(strDate);
}i used prepared statement even now i am getting error like this.....
i have included the prepared statement package also...
my coding:
ResultSet rsdatetemp = null;
PreparedStatement ps = null;
String query ="select distinct itemcode from sales where bill date between ? and ?";
ps = precon.prepareStatement(query);
ps.setDate(1,d1);//d1 and d2 are in date format
ps.setDate(2,d2);
rsdatetemp = ps.executeQuery();
error :
symbol : method setDate(int,java.util.Date)
location: interface java.sql.PreparedStatement
ps.setDate(1,d1);
symbol : method setDate(int,java.util.Date)
location: interface java.sql.PreparedStatement
ps.setDate(2,d2); -
How to convert a String to an Icon
Hello,
I'm trying to figure out how to convert a String (specifically one letter) to an Icon for a JTree. The program I am working on uses .png files for the icons at the moment, with each .png being a single uppercase letter. However, recent discussion has us wanting to change to something more dynamic, since we anticipate needing new letters in the near future.
My task is to modify the current codebase so that the Icons used to identify nodes in the tree are created from a Font within code, rather than reading in .png files. I have done some experimenting with creating a Label with just that String, setting the font and trying to extract the image using calls like createImage(int width, int height) and so on, but so far to no avail.
If I could figure out how to at least convert the String to an image, I could probably make it work (since I can play around with creating an ImageIcon with that image). Thanks in advance for any help.
AllanHere is some quick and dirty code:
import java.awt.*;
import javax.swing.*;
public class BasicIcon implements Icon {
private String text;
public BasicIcon(String text) {
this.text = text;
public int getIconWidth() {
return 16;
public int getIconHeight() {
return 16;
public void paintIcon(Component c, Graphics g, int x, int y) {
Color old = g.getColor();
g.setColor(c.getForeground());
g.drawString(text, x, y+13);
g.setColor(old);
public static void main(String[] args) {
JPanel cp = new JPanel();
for (char ch = 'A'; ch < 'F'; ++ch) {
cp.add(new JButton("letter " + ch, new BasicIcon(String.valueOf(ch))));
JFrame f = new JFrame("BasicIcon");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setContentPane(cp);
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
}One thing that could be improved is the vertical positioning of the letter in the Icon.
The x,y values passed into paintIcon are the upper-left hand corner of the icon,
but the y value needed by drawString is the position of the String's baseline.
To do it right, use one of Font's getLineMetrics methods and play around with ascent. -
How to search a string from the database?
how to search a string from the database? starting with some character
If you're trying to do this in a SELECT, you can use the LIKE verb in your WHERE clause.
Here's an Example
SELECT obj_name FROM tadir
INTO prog
WHERE pgmid = 'R3TR'
AND object = 'PROG'
AND obj_name LIKE 'Z%'.
In this case it will select every row that obj_name starts with Z.
If you wanted to find every row that the field obj_name contains say... 'WIN' you use LIKE '%WIN%'.
Edited by: Paul Chapman on Apr 22, 2008 12:32 PM -
How to transfer a string from sub sequence to main sequence
Hi,
How to transfer a string from sub sequence to main sequence, My main sequence has included a sub sequence, the sub sequence is return a string value after running done, I need to get this string value from sub sequence to main sequence, I check the defined that look like seem the two
sequence have themself local variable,but I don't know how to defined a globe variable to cover main sequence and sub sequence like VC++'s Main App ,Please kindly help me,thanks in advance...Hi,
I hope this small example will help you.
Regards
Ray Farmer
Regards
Ray Farmer
Attachments:
Sequence File1.seq 36 KB -
How to read a string from file & assign the val to a variable in batch file
Hi,
How to read a string from a file and assign the value to a variable then return the value to the screen in windows batch file?
Any suggestions?
thanks.Unless this is a homework question then I don't see the purpose of doing this, but....
You should be looking a the supplied package utl_file to get the string out of the file, dbms_output to display the string and then google windows batch/command files calling sqlplus to execute your program.
Andre -
How to build a String from Date?
How to build a String from class Date?
How to get the year, month, day, hour ... from a Date object.Ok to build a string use this function in java.util.Date
toString()
TO get year, date, etc u can use the following functions
getYear()
getDate()
This link might help u more
http://java.sun.com/products/jdk/1.1/docs/api/java.util.Date.html -
How to convert a string into an objects name?
Hi
I have the following problem;
I have a string
String a = "e1"
and a method
call(Event e1) that calls the "Event" class with object the name of the string a.
How can I convert the strings name into an object so as to use it in the "call" method?
Any ideas?
Thanks in advanceI don't know if this helps you, but you can do things like this.
String a = "com.example.SomeEvent";
//Instantiate com.example.SomeEvent
Object o = Class.forName(a).newInstance();SomeEvent must have a non-argument constructor for this to work.
Class that will be instantiated depens on runtime value of String a, and can be different across different executions of the program. -
GRC CUP - How to change SNC Name to lower case during user creation.
Hi All,
We are using GRC 5.3. CUP automatically creates user in R3 but SNC p:username'@'DOMAIN.COM is in upper case.
1. During automated user creation.
2. How change default DOMAIN.COM to lower case "domain.com"
Currently we have to manually change is via SU01 after user has been created.
Thank you
Regards,
JackySorry please ignore this thread. I got the wrong details. Post cancelled
Maybe you are looking for
-
Having a problem with app files and fonts between OS
I work in a prepress department, and we are have issues with files that are coming from 10.4.11 to 10.5.8. The 10.4.11 is a power PC and the 10.5.8 is Intel. Fonts get corrupt and display as a unix file with 0 file size and application files like Qua
-
Exporting An message Internal table to Standard program Internal Table
Hi, In T-code VOFM, We have Goods issue routine 113, Now in Custmizing 913 is Configured. we are Checking the status of each handling unit of the Delivery. So I am getting the status Incomeplete Message for Multipe HU's. hence AM storing into One i
-
Am considering buying a Time Capsule. But all specs I read about it (re: printing) is how to hook up a printer via USB connection. Need to confirm...that a wireless printer will work with the router feature of the Time Capsule. I assume yes...?
-
Managing constants in large applications
This is an issue that has come up many times in my projects. While I try to avoid the practice, I almost always have some sort of Constants.java class that contains a bunch of public static final constants. This includes things like application name,
-
Showing pdf file into an RTF report
Hi all, At the end of my report I need to show a PDF file that I get from the table fnd_lobs, so in my xml I had a BLOB tag with the PDF. I know that this is possible with images using this: <fo:instream-foreign-object content type="image/jpg"> <xsl: