How to take last 5 char from a string
Hi All
I have a requirement,
base on some comp i have to populate another field.
in this case i have compare last 3 char of a string
example if total string say asasdffrx i have to take last three char here it is frx.
always i have to last 3 char.
i can use +6(3) but it wont work every time because string lenght is not fix for all vaue.
thanks
Hi,
A.H.P sample is ok but insert additional check for strigs shorter than 3 (to avoid negative offset):
data : n TYPE I.
n = STRLEN( zfield ) - 3.
if n >= 0.
result = zfield+n(3).
else.
result = zfield.
endif.
Krzys
Similar Messages
-
How to get a char from a String Class?
How to get a char from a String Class?
Use charAt(int index), like this for example:
String s = "Java";
char c = s.charAt(2);
System.out.println(c); -
How to remove last char in a string by space
I have to implement backspace application(remove a last char in a string , when we pressed a button).
for ex: I enter the no
1234
instead of 1236
So when i press a button on the JWindow... it should display
123
so that i can enter 6 now.
I tried to display the string "123 " instead over "1234" but it is not working when the no background is specified. but works fine when a background color is specified.
The string is displayed as
Graphics2D g = (Graphics2D)window.getGraphics();
AttributedString as = new AttributedString(string, map);
g.drawString(as.getIterator(),x,y);
In the map, the background is set to NO_BACKGROUND.
Thanks and regardsDeja vu. I saw this kind of post before, and I'm sure
it was today.http://forum.java.sun.com/thread.jspa?threadID=588110&tstart=0
Here it is. -
How to take the values from a String ( CSV values).
Hi All,
I am passing csv String to a procedure as in parameter,but I have to take the values from a csv String one by one.Please let me know Is there any StringTokenizer function in oracle to take values like in java. Here is my javacode.
import java.util.StringTokenizer;
public class Sample {
public static void main(String[] args) {
String s="one,two,three,four,five";
StringTokenizer stringTokenizer=new StringTokenizer(s,",");
System.out.println( stringTokenizer.countTokens());
System.out.println(stringTokenizer.hasMoreTokens());
while(stringTokenizer.hasMoreTokens()){
System.out.print(stringTokenizer.nextToken());
o/p: one two three four fiveSomething based around one of these two methods should assist...
select substr( the_string
, decode( level, 1, 1, instr(the_string,',',1,level-1)+1)
, decode( instr(the_string,',',1,level), 0, length(the_string), instr(the_string,',',1,level) - decode( level, 1, 0, instr(the_string,',',1,level-1))-1)
) the_value
from ( select '10,12,20,30,30,3,12,12,56' the_string
from dual
connect by level < length(replace(translate(the_string,'01234567890','00000000000'),'0')) + 2
or
SQL> select REGEXP_SUBSTR ('a,b,c,d,e', '[^,]+', 1, level) from dual connect by level<=5
2 /
REGEXP_SU
a
b
c
d
e
SQL> -
How to remove empty char from a string
Hi,
In my code I should get numeric int numbers and convert them to 1 and 0 , concatenate thm to make an string ( 8 chars) . the problem I have is the empty chars as result of conversion from number to string
so lets say pxiAnaIn=1 dutVdd=2 and dutOut=5 so then the output should be 10110001 but now the output is 10110 1 . could you please let me know how can I fix this problem
thankstintin_99 wrote:
Hi,
In my code I should get numeric int numbers and convert them to 1 and 0 , concatenate thm to make an string ( 8 chars) . the problem I have is the empty chars as result of conversion from number to string
so lets say pxiAnaIn=1 dutVdd=2 and dutOut=5 so then the output should be 10110001 but now the output is 10110 1 . could you please let me know how can I fix this problem
thanks
You could make your life a little easier and only use 1 format string. Use "%03b%02b%03b" for the format string. You can then expand the format string to allow multiple inputs. You will do the job of 4 functions with just 1.
"%3b" just says to give 3 spaces for the binary number. But any preceding 0s will be turned into spaces. Adding the 0 in there tells the format string to prepend 0s instead of using spaces.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
How to delete the last char in a String?
i want to delete the last char in a String, but i don't want to convert the String to a StringBuffer or an array, who knows how to do?
Try it in this way
String MyString = "ABCDEF";
MyString = MyString.substring(0,MyString.length()-1); -
Deleting the last char of a string
How can I Delete the last char of a string???
example:
asd@fdg@vvdfgfd@gdgdfgfd@gdfgdf@
I want delete the last @!
Tks in advance!hi,
try this:
lv_count = strlen(string).
lv_count_last = lv-count - 1.
replace string+lv_count_last(lv_count) in string by ' '.
This should work.
thnx,
ags.
Edited by: Agasti Kale on Jun 4, 2008 9:03 PM -
Deleting last char in a string...
I have a string that is created as follows: strBuffer += k.getKeyChar();(k is KeyPressed ...KeyEvent) How can I delete the last Char in the string strBuffer?
Hi
// simply substring
if (strBuffer.length() > 1)
strBuffer = strBuffer.substring(0, strBuffer.length()-1);
// you may also use
if (strBuffer.length() > 1)
StringBuffer buffer = new StringBuffer(strBuffer).
deleteCharAt(strBuffer.length()-1);
strBuffer = buffer.toString();
}I've not tested the above code myself & I've written the above code on the go after reading your query. The above code definitely work & help you.
Regards,
JPassion -
How to create session id from different string controls
how to create session id from different string controls
fais,
Please create the VI you are talking about and save some default data into all of the controls. Also on the front panel, place the session ID that should be generated by that data. Now, post your VI to a response so I can download it. I can then take this VI and help you create the functionality. (Please post what version of LabVIEW you are using.)
My guess it that you are going to need to use a good number of string concatenations as well as a few string indexes to get parts of strings out. As for the date, you can use a Property node with the Numeric Text.Text property to get the actual string displayed on the front panel for the date and parse out the parts that you want.
Randy Hoskin
Applications Engineer
National Instruments
h
ttp://www.ni.com/ask -
How to take the data from sage system to sap r/3
hi expects,
how to take the data from sage system to sap r/3? which adapter is to be used?what is the format of data in sage system?how the scenarios will work ? please help me in solving this problem?hi rohit,
the data transfer can be done by using SOAP adapter
do chk this link
http://www.sage.org/lists/sage-members-archive/2001/msg01718.html
http://www.sage.org/lists/sage-members-archive/2001/msg01739.html
thanx
Sampath -
How to remove the Char.from one Operating Concern
Hi Guys,
How to remove the Char. from one Operating Concern.
I have created one Char. (WWDOC) and moved to Operating Concern (OOCC). Operating Concern is in red status.
Now, i want to remove that new assigned Char. (WWDOC)from the operating concern (OOCC). I did't find any option in the menu also.
Appreciate your help.....
T&R
VVRHi Sasi,
Iam not able to push back that char. from my operating concern. In help it is given you have to delete the data contents in the table before pushing back. Please let me know if any other option available.
Thanks for your reply.
VVR -
Finding last char in the string
Hi
i need to find out whether the last char of a string is '/' (forward slash). please let me know if there's a FM to do that. Other post me the logic for this ASAP.
thankslen = strlen(char).
len = len - 1.
if char+len(1) = '/'.
*write ur code
endif.
chk this code
REPORT ychatest.
DATA : str(5) VALUE '123/',
len TYPE i.
len = STRLEN( str ).
len = len - 1.
IF str+len(1) = '/'.
WRITE : '/ found'.
ENDIF.
<b>Reward points if helpful and close thrad if solved</b>
Message was edited by: Chandrasekhar Jagarlamudi -
I am using the hp 3525 model printer , i like to know how to take photo print from the printer
Hi,
I am using the hp 3525 model printer , i like to know how to take photo print from the printer .
Regards
Mukesh.RHi Mukesh,
I'd like to help, but can you clarify the issue? Are you asking how to print a photo from your printer? Also, can you confirm that your printer is a HP Deskjet Ink Advantage 3525 e-All-in-One Printer?
Thanks!
Tara
**Although I am an HP employee, I am speaking for myself and not for HP. -
How delete my last application from app?
HOW DELETE MY LAST APPLICATION FROM APP
Sorry I don't understand what you are asking.
And Please do not post in All Caps. Thanks. -
How to Remove the Spc Char from a String ?
Hi
I am trying to stream out the file name after useing Timestamp. It throws some exception
So I used the trim method for remove the space and spacial charater. But does't trim even space also.
Please any body help me how to remove the space and spceial characters from my string.
The file name ( String of value)
2c5e773bad5e153cf91d7adabc121e62007-03-30 21:54:43.219.ivwr
the file name after removing will be like this
d2c5e773bad5e153cf91d7adabc121e620070330215443.ivwr
pls help me
Thanks,
Merlin Roshinafilename = filename.replaceAll("(?!\\.ivwr$)[- :.]","");
Maybe you are looking for
-
How do I get back my original loops without the CD?
I had to get my computer reset due to some sort of compromise and in the process I lost a lot of files. I'm pretty sure this is how I lost the Apple Loops that come with Garageband. My Garageband runs fine and I can create projects and record via inp
-
BAPI to retrieve ship to party for a given sold to party
Hi All, I have a requirement to get the ship to party details for a sold to party. The scenario is that we are using an excel sheet for order loading at the client's place. The CSR enters the sold to party in the excel sheet and there is a funcationa
-
5D Mark III firmware suggestions
Hello, Could Canon team give us their positions on these suggestions please ? 1) The Auto ISO is far from being convenient. - Could we specify the min shutter speed instead of being limited to a restricted number of predefined values ? - When shutter
-
Installation designer 9i (please)
I have installed designer9i suite and database in different home database : home=orahome9 path=c:\oracle\ora90 designer : home=des9 path=c:\dersigner\des90 and i have problems with designer(forms,designer,reports) thank you.
-
Change to planned amount on invoice
All, We have a situation where the invoice change history indicates someone changed the "planned amount" on an invoice. Can anyone tell me where the planned amount is on an invoice and how someone can change this value? It is related to a consignme