Find the last character in an aplhanumreic string

Hi guys first time poster long time hiding in the shadows,
hopefully someone can help me
I have set of username stored and I need to find the last
character before the number for example
abc123 I would want to find c
ab123 I would want to find b
any suggestions as to how I would do this?
Thanks in advance

Here's one way:
<CFSET YourString = "abc123")>
<CFSET LastChar = "">
<CFSET Pos = 1>
<CFSET CharLen = Len(YourString)>
<CFLOOP from="1" to="#CharLen#" step="1">
<CFSET Char = right(left(YourString,Pos),1)>
<CFIF Not IsNumeric(Char)>
<CFSET LastChar = Char>
<CFSET Pos = Pos + 1>
<CFELSE>
<CFBREAK>
<CFIF>
</CFLOOP>

Similar Messages

  • How we can find the last character in a string(Urgent Plz!)

    Gurus!
    How we can find the last character in a string.
    e.g i have a string say "Str" with value "10-01".
    Now i want to find the last character in "Str" i.e "ONE=1".
    i am using Oracle developer 6i with Oracle 8i(1.7).
    Plz help!
    Many thanks!

    Use the substr() and length() functions -
    x := '10-01';
    y := substr(x, length(x));

  • How to find the special character in a give string/sentance

    Hi All,
    I have one task to complete with in the give time. Since i am not very good in PL/SQL i need your your help.
    Requirement is :
    I have to come up with the SQL or PL/SQL code which should return and find the special or hidden character in the datafiles name in a database. There are nearly 400+ database are present in almost all the flavor of UNIX and i have to check the each and every database.
    As you know , Name of the data file will be like this :
    /u02/instance_name\oradata\datafile_01.dbf So it should avoid these things and find out only the special characters in the datafile name.
    a-z , A-Z , 0-9 and \ Please keep in mind that ...... I will be firing the Oracle script from Oracle 9i client which will access all the database from Oracle 9i to 11g in one short and give me the result.
    Please help me to resolve this issue and let me know if you need more information.

    Hi,
    Mukesh wrote:
    Hi Frank,
    This is excellent function. Thanks for you responce.
    I want to modify this query in such a way that .... i should get only those datafiles name which are holding special characters. I don't know how to put this in where condition. :( Here's one way:
    SELECT  file_name
    ,       ...     -- other expressions, if you want any
    FROM    dba_data_files
    WHERE   TRANSLATE ( file_name
                      , '?0123456789.ABCDEFGHIJKLMNOPQRSTUVWXYZ\_/abcdefghijklmnopqrstuvwxyz'
                      ) IS NOT NULL Among the other expressions you can put into the SELECT clause (if you want to) is a copy of the TRANSLATE function, as you had in your message. That would highlight exactly which character(s) made the file_name invalid.

  • How to find the last string value in dynamic object?

    Hi All,
    I am trying to find the last string value in dyanamic objects,Any one have solution for this.
    Ex:
    my data :12347-ebjdone-525-ecgfjf-25236-defdafgdeg
    And i want to show the output is :defdafgdeg
    Any ideas:
    Thanks
    Srini

    For oracle try using oracle function.
    e.g.
    SELECT  reverse(substr(reverse('12347-ebjdone-525-ecgfjf-25236-defdafgdeg'),1,instr(reverse('12347-ebjdone-525-ecgfjf-25236-defdafgdeg'),'-','1'))) from dual
    Object definition might look like:
    reverse(substr(reverse({ObjectName}),1,instr(reverse({ObjectsName}),'-','1')))
    Regards,
    Kuldeep
    Edited by: Kuldeep Chitrakar on Feb 12, 2010 8:12 AM

  • Want to single out the last character of a string

    There is a field where there are many strings of varying length. E.g.: AB001XUV, AB003XUK, DJ8933FXUV etc.
    From these strings I need to create a virtual column where only the last character is shown. So it shall be V, K, V for values from the above example.
    Can anyone please suggest me how to achieve this.
    Regards
    Hawker

    SQL> with t as (
      2  select 'AB001XUV' col from dual
      3  union
      4  select 'AB003XUK' col from dual
      5  union
      6  select 'DJ8933FXUV' col from dual
      7  )
      8  select substr(col,-1,1) from t
      9  /
    S
    V
    K
    V
    SQL> create table temp(id number,
                      col varchar2(10),
                      VIRTUAL_COL VARCHAR2(1)   GENERATED ALWAYS AS (substr(col,-1,1)) VIRTUAL
    SQL> insert into temp(id,col) values(1, 'AB001XUV') ;
    SQL> select * from temp ;
            ID COL        V
             1 AB001XUV   V
    SQL> Edited by: Azhar Husain on Aug 16, 2011 1:17 PM

  • Testing the last character of a string using .endsWith

    Hi,
    I want to check to see if the last character of a string is '@'.
    I tried if (StringAt.endsWith("a")) {
    but got no results.
    Is this the correct way to do it or is there another way.
    Thanks.
    Adam

    javadocs:
    String's endsWith method takes a string argument.
    endsWith
         public boolean endsWith(String suffix)
              Tests if this string ends with the specified suffix.
              Parameters:
                   suffix - the suffix.
              Returns:
                   true if the character sequence represented by the argument is a suffix of the character sequence
                   represented by this object; false otherwise. Note that the result will be true if the argument is the
                   empty string or is equal to this String object as determined by the equals(Object) method.
              Throws:
                   NullPointerException - if suffix is null.

  • How can I stop the last character of my password from being displayed?

    Sorry, I'm sure this would have been asked before, but I couldn't locate it..
    When unlocking my iPad, how can I stop it from displaying the last character of my password to everyone in the vicinity? This has got to be the fastest way to find out someone's password (just look at the screen as they type their 'secure' password!?). Having the iPad display your password letter by letter is really not acceptable when working in a non-secure environment.
    Is there a setting somewhere, or will this be addressed in a new iOS, or just ignored as a 'that's the way it is'?
    Thanks in advance,
    Andy

    AdventureBear wrote:
    Hi,
    This may have been the way it has been on iOS since 2008 (not sure about that though), however I know (based on working in the IT industry for 20 years) that nobody on this planet can successfully argue that it would be 'acceptable security practice', for me to display 'every last letter' as I type of a secure 'root' password on my screen every day when you log in... Nobody would think it acceptable to display even their LAN/Domain password on the screen in this same manner. So why is iOS different?!
    iOS on a phone (it used to be argued) doesn't need to be very secure as it is almost entirely phone numbers and email addresses that are being stored. However in recent years when the applications got better, and tablets came out, security became a much bigger issue as more and more people started using the functions of 'smart' phones to store more 'sensitive' data.
    Kind regards,
    Andy
    Are you suggesting that someone looking over your shoulder can't see the keys that you're tapping with your fingers? In the interest of security, i would never, under any circumstances, enter a password when others are around.

  • How do I drop the last 3 characters in a string?

    Hello.  I'm trying to find a way to drop the last 3 characters in a string.  The length varies because it is a last name field.  The problem is that when a customer has a suffix on their name, III for example, it is appended to the last name all in the last name field.  If I use the ProperCase function, I end up with "Smith Iii".  How can I tell it to drop the last 3 characters?  I'll then append an UpperCase edition of the last 3 characters to that.  Thank you!

    Use the instring and right string functions then UpperCase

  • How to find the last execute query

    Hi, Is there a way to find the last executed query of report?
    Thanks
    Aali
    Edited by: aali on 22-Feb-2010 06:39

    Hi,
    if you hold the necessary privileges, you might find the SQL in the shared pool:
    select last_active_time, parse_calls, disk_reads, buffer_gets, cpu_time, end_of_fetch_count, executions, plsql_exec_time, sql_text
    from V$SQLSTATS
    where sql_text like '% some distinctive string %'
    order by last_active_time desc;if you insert some meaningful string in form of comment inside the query itself, say /* report #1 on page 3 */
    you may be able to track it down more easily.
    select last_active_time, parse_calls, disk_reads, buffer_gets, cpu_time, end_of_fetch_count, executions, plsql_exec_time, sql_text
    from V$SQLSTATS
    where sql_text like '% report #1 on page 3  %'
    order by last_active_time desc;Bye
    Flavio
    http://oraclequirks.blogspot.com

  • How can I select the last 2 chars of a string

    Hello all,
    I am trying to select the last 2 characters of a string to match them to another string. This is for a Poem generator that contains 20 or so words and I have to pick 2 words at random, them look at the last 2 characters to see if they match in each string. Say "Plain" and "Rain" would match because they both have "in" at the end. The length of each word could vary. I don't want this doing for me just what Method should I be looking at.
    Thanks.

    hi,
    try this:
    public class StringTest {
         public static void main(String args[]) {
              StringTest obj = new StringTest();
              obj.same();
         void same() {
              String rain = new String("Rain");
              String plain = new String("Plain");
              int rainLength = rain.length();
              int plainLength = plain.length();
              if(rain.substring(rainLength-2).equals(plain.substring(plainLength-2))) {
                   System.out.println("same");
              else {
                   System.out.println("different");
    }you can use the length method to get the length of a string and then use the substring method, passing it length-2, so get the last 2 chars.

  • How to re-add the iPhone into the Find My iPhone and than to find the last known possition?

    Hello,
    I've got my iPhone stolen yesterday in the bar.
    In the morning I tried find it by Find My iPhone app but I hit the "remove" button by mistake. Is it possible to reverse this acction even without the iPhone in the hand?
    I need to re-add the iPhone into the iCloud (Find My iPhone) and than to find the last known possition. It's serial number is C3******39D
    Thank you
    Libor
    <Edited bu Host>

    Ringtones are a one-time only download from the store. You will need to connect the device that you downloaded it on to your computer's iTunes and do File > Devices > Transfer Purchases to copy it over to the Tones part of your computer's iTunes library and you can then sync it to your other device(s).

  • Downloading ALV to EXCEL - in some fields the last character is missing ...

    Hi,
    I am experiencing this kind of problem when downloading ALV report into Excel :-
    "You are downloading an ALV result to an EXCEL file. In some fields the last character is missing."
    For example, if MATNR is 0000234567 in display but after downloading to excel it becomes only 23456.
    I found another related forum thread : Pronlem while downloading ALV grid to excel
    I tried the suggested method to apply OSS note 1075315. However, the note cannot be implemented in the system. I am working in a ECC6 environment (SAP version 700, 701).
    Kindly please help me if you came across the similar kind of issue. Thanks much.

    Hi gkGoh8     ,
    The link thread that you just gave already provided the answer, in your field catalog you need to activate field lzero.
    1. Check FM : REUSE_ALV_GRID_DISPLAY
    2. Import Parameter tab :IT_FIELDCAT
    3. Double click SLIS_T_FIELDCAT_ALV
    4. On type group SLIS, check line 93
    Regards,
    JQC

  • How to find the last login details of a Sharepoint SSRS user

    How to /where to find the last login details of SSRS sharepoint user. Is there any table where we can check the last login details of user. This is because we are facing an issue of Subscription failure due to Sharepoint token expiration. If user logs in
    before 24 hours of his last login time, he is able to get his report subscription. If not, below error is thrown.
    The permission granted to user 'domainname\username' are insufficient to perform this operation.

    Hi,
    According to your post, my understanding is that you want to monitor the last login user’s details.
    There is no out of the box way to achieve it in SharePoint.
    We can use cookie to be a flag for checking whether there is an user just log in. After the page loaded, if the cookie is null, it suggests that there is an user just log in our site, then we
    can get this user’s information using JavaScript Object Model and add the information into a custom list. With this list, we can monitor user’s login details.
    Refer to the following link:
    https://social.technet.microsoft.com/Forums/en-US/0cd4d531-cb61-4d90-aa70-413267f4a735/how-to-know-login-and-logout-details-of-a-user-in-sharepoint-online-2013?forum=sharepointdevelopment
    Besides, here are two similar posts for your reference:
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/1a35283e-0f2a-49b8-b330-801a3cfcd890/programatically-get-all-current-logged-in-users-list-for-a-sharepoint-site?forum=sharepointdevelopmentprevious
    https://social.technet.microsoft.com/Forums/en-US/10953be3-cb1c-40c7-9454-545c8338b551/how-to-know-login-users-count-and-their-details-in-sharepoint-2010-web-application?forum=sharepointgeneralprevious
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

  • Why does Preview automatically resize the text box to cut off the last character of added text? How do I fix it?

    Why does Preview automatically resize the text box to cut off the last character of added text? How do I fix it?
    I use the Tools > Annotate > Add Text feature, and when I click away after adding text, it automatically changes the text box size such that the last letter -- or last word -- gets bumped off into an invisible line below it, forcing me to manually adjust every single text box. It is highly annoying when trying to complete PDF forms (e.g. job applications).
    It appears to be a glitch, quite honestly, an error resulting from Apple's product design. Has it been fixed in the new operating system (for which they want $30)?
    I would very much appreciate any help you can provide! Thank you for your time.

    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites that cause problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • Function to find the Last Date of Month One Year Ago - RETURNS ERROR

    I've written sql code which takes a date and finds the Last Day of the Month one year ago. For example,  it takes the date '2015-04-17' and returns the date '2014-04-30'. The code works fine in a query. Now I'm trying to turn this into a function. However,
    when I try to create the function I get the error:
    Operand type clash: date is incompatible with int
    Why is this error being returned?
    Here is my function:
    CREATE FUNCTION dbo.zEOM_LY_D(@Input Date)
           RETURNS date
    AS
    BEGIN;
      DECLARE @Result date;
      SET @Result =  convert(DATE, DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,dateadd(m, -11, @Input)+1),0)),101)
        RETURN @Result;
    END;
    Thanks for any help you can give.
                     

    Stan,
    Thanks very much- that does the trick. I should have said I am using SQL 2008 so EOMONTH is not available to me. I still don't get why I got an error though, since I was treating a date like a date and not like an int.
    Thanks, John
    I think i found the issue but i do not know why it is causing the issue. i think may be the way dates are treated/stored internally..i think dates are stored as no of days after 0001/01/01 but cannot see how this cwould effect..may be somebody else can through
    some light..... 
    if you make it as datetime it will work,
    if you leave it as date - eliminate adding 1...  you should prefer to use dateadd to add/substract dates.
    try this to understand..
    --removed the +1 in the code
    declare @input date
    set @input ='20150503'
    select
    convert(DATE, DATEADD(s,-1,DATEADD(mm,DATEDIFF(m,0,dateadd(m, -11, @Input)),0)),101)
    go
    --made the datatype as datetime
    declare @input datetime
    set @input ='20150503'
    select
    convert(DATE, DATEADD(s,-1,DATEADD(mm,DATEDIFF(m,0,dateadd(m, -11, @Input)+1),0)),101)
    Hope it Helps!!

Maybe you are looking for

  • Plzzzzz help with  NO SOUND ON IPHONE 4 after upgrade to iOS 5.1.1

    Previously I have ios 5.0.1 on iPhone 4, recently I upgrades to iOS 5.1.1 . After some hours I noticed that my phone is just vibrating, not ringing. I checked the orange button, tried all cleaning procedures. No music, no lock sounds, nothing from th

  • Connecting SAP Netweaver ABAP Trial Version from 2 Laptops

    Hi All, I have a scenario where in I have installed SAP NetWeaver  ABAP  Trial 7.1 version on one Laptop. All the Presentation and application server are also installed on the same laptop and everything is working fine. Here NetWeaver  is installed o

  • Difference Between Book on sap press and Advice on which book I should take ?

    Hello, Could someone explain me the difference between those two Sap Press. SAP CRM Web Client Customizing and Development http://www.sap-press.com/products/SAP-CRM-Web-Client-Customizing-and-Development.html SAP Web Client: A Comprehensive Guide for

  • RMI Performance Comp. with Forte

    Hi All, I know that this topic has been discussed on the list already, but I would like to find out whether the current state of Sun's RMI implementation is like I imagine it, and I want to compare with our Forte Service objects too. Basically, these

  • Aperture and iPhoto synching

    I used iPhoto for a long time before I got Aperture. I was able to import my iPhoto library to Aperture, but it drives me crazy that I can only use one or the other. Is there any way to synch the libraries? I say this for two reasons: 1) When I downl