How to find 2 different characters from a string

Hi All,
I would like to remove 'T' and 'Z' from "20110428T10:33:45Z" and convert the string in date/time. I was looking at instr function but that allows to search for one character only.
Thans for the help.

With 10g
SELECT REGEXP_REPLACE ('20110428T10:33:45Z', '[T|Z]') dt
  FROM DUAL
DT             
2011042810:33:45
1 row selected.For the conversion
SELECT TO_DATE (REGEXP_REPLACE ('20110428T10:33:45Z', '[T|Z]'),
                'YYYYMMDDHH24:MI:SS'
               ) dt
  FROM DUAL
DT       
2011-04-28 10:33:45
1 row selected.

Similar Messages

  • How to find different styles from Indesign CS4 Grap style?*

    Hi,
    I would like to know how to find two different character style from a single grap command in Indesign CS4.
    For instance, A word having bold/italic character style following with punctuation having normal/none character style.
    Thanks for your help!
    Regards,
    Bharat

    With GREP styles you can search text only, not formatting.
    Peter

  • Regular expressions-how to replace [ and ] characters from a string

    Hi,
    my input String is "sdf938 [98033]". Now from this given string, i would like to replace the characters occurring within square brackets to empty string, including the square brackets too.
    my output String needs to be "sdf938" in this case.. How should I do it using regular expressions? I tried several possible combinations but didn't get the expected results.

    "\\s*\\[[^\\]]+\\]"

  • Removing non-alpha-numeric characters from a string

    How can I remove all non-alpha-numeric characters from a string? (i.e. only alpha-numerics should remain in the string).

    Or even without a loop ?
    Extract from the help for the Search and Replace String function :
    Right-click the Search and Replace String function and select Regular Expression from the shortcut menu to configure the function for advanced regular expression searches and partial match substitution in the replacement string.
    Extract from the for the advanced search options :
    [a-zA-Z0-9] matches any lowercase or uppercase letter or any digit. You also can use a character class to match any character not in a given set by adding a caret (^) to the beginning of the class. For example [^a-zA-Z0-9] matches any character that is not a lowercase or uppercase letter and also not a digit.
    Message Edité par JB le 05-06-2008 01:49 PM
    Attachments:
    Example_VI_BD4.png ‏2 KB

  • Removing characters from a String (concats, substrings, etc)

    This has got me pretty stumped.
    I'm creating a class which takes in a string and then returns the string without vowels and without even numbers. Vowels and even characters are considered "invalid." As an example:
    Input: "hello 123"
    Output: "hll 13"
    The output is the "valid" form of the string.
    Within my class, I have various methods set up, one of which determines if a particular character is "valid" or not, and it is working fine. My problem is that I can't figure out how to essentially "erase" the invalid characters from the string. I have been trying to work with substrings and the concat method, but I can't seem to get it to do what I want. I either get an OutOfBoundsException throw, or I get a cut-up string that just isn't quite right. One time I got the method to work with "hello" (it returned "hll") but when I modified the string the method stopped working again.
    Here's what I have at the moment. It doesn't work properly for all strings, but it should give you an idea of where i'm going with it.
    public String getValidString(){
              String valid = str;
              int start = 0;
              for(int i=0; i<=valid.length()-1; i++){
                   if(isValid(valid.charAt(i))==false){
                             String sub1 = valid.substring(start, i);
                             while(isValid(valid.charAt(i))==false)
                                  i++;
                             start=i;
                             String sub2 = valid.substring(i, valid.length()-1);
                             valid = sub1.concat(sub2);
              return valid;
         }So does anybody have any advice for me or know how I can get this to work?
    Thanks a lot.

    Thansk for the suggestions so far, but i'm not sure how to implement some of them into my program. I probably wasn't specific enough about what all I have.
    I have two classes. One is NoVowelNoEven which contains the code for handling the string. The other is simply a test class, which has my main() method, used for running the program.
    Here's my class and what's involved:
    public class NoVowelNoEven {
    //data fields
         private String str;
    //constructors
         NoVowelNoEven(){
              str="hello";
         NoVowelNoEven(String string){
              str=string;
    //methods
         public String getOriginal(){
              return str;
         public String getValidString(){
              String valid = str;
              int start = 0;
              for(int i=0; i<=valid.length()-1; i++){
                   if(isValid(valid.charAt(i))==false){
                             String sub1 = valid.substring(start, i);
                             while(isValid(valid.charAt(i))==false)
                                  i++;
                             start=i;
                             String sub2 = valid.substring(i, valid.length()-1);
                             valid = sub1.concat(sub2);
              return valid;
         public static int countValidChar(String string){
              int valid=string.length();
              for(int i=0; i<=string.length()-1; i++){
                   if(isNumber(string.charAt(i))==false){
                        if((upperVowel(string.charAt(i))==true)||lowerVowel(string.charAt(i))){
                             valid--;}
                   else if(even(string.charAt(i))==true)
                        valid--;
              return valid;
         private static boolean even(char num){
              boolean even=false;
              int test=(int)num-48;
              if(test%2==0)
                   even=true;
              return even;
         private static boolean isNumber(char chara){
              boolean number=false;
              for(int i=0; i<=9; i++){
                   if((int)chara-48==i){
                        number=true;
              return number;
         private static boolean isValid(char chara){
              boolean valid=true;
              if(isNumber(chara)==true){
                   if(even(chara)==true)
                        valid=false;
              if((upperVowel(chara)==true)||(lowerVowel(chara)==true))
                   valid=false;
              return valid;
    }So in my test class i'd have something like this:
    public class test {
    public static void main(String[] args){
         NoVowelNoEven test1 = new NoVowelNoEven();
         NoVowelNoEven test2 = new NoVowelNoEven("hello 123");
         System.out.println(test1.getOriginal());
         //This prints hello   (default constructor string is "hello")
         System.out.println(test1.countValidChar(test1.getOriginal()));
         //This prints 3
         System.out.println(test1.getValidString());
         //This SHOULD print hll
    }

  • Removing non english characters from my string input source

    Guys,
    I have problem where I need to remove all non english (Latin) characters from a string, what should be the right API to do this?
    One I'm using right now is:
    s.replaceAll("[^\\x00-\\x7F]", "");//s is a string having chinese characters.
    I'm looking for a standard Solution for such problems, where we deal with multiple lingual characters.
    TIA
    Nitin

    Nitin_tiwari wrote:
    I have a string which has Chinese as well as Japanese characters, and I only want to remove only Chinese characters.
    What's the best way to go about it?Oh, I see!
    Well, the problem here is that Strings don't have any information on the language. What you can get out of a String (provided you have the necessary data from the Unicode standard) is the script that is used.
    A script can be used for multiple languages (for example English and German use mostly the same script, even if there are a few characters that are only used in German).
    A language can use multiple scripts (for example Japanese uses Kanji, Hiragana and Katakana).
    And if I remember correctly, then Japanese and Chinese texts share some characters on the Unicode plane (I might be wrong, 'though, since I speak/write neither of those languages).
    These two facts make these kinds of detections hard to do. In some cases they are easy (separating latin-script texts from anything else) in others it may be much tougher or even impossible (Chinese/Japanese).

  • How to find delete message from iphone

    how to find delete message from iphone?

    I am afraid that I don't think there is a way to do this.

  • How to find server model from 11g OEM mgmt$ views

    How to find server model from 11g OEM mgmt$ views
    server model like Dell 710, DL380 G7 etc..,

    It is included in this query (run as user SYSMAN):
    SELECT t.target_name AS host_name,
    ecm_util.HOST_HOME_LIST (t.target_name, t.target_type) AS home_info,
    hw.vendor_name AS Vendor,
    hw.system_config AS System_Config,
    hw.machine_architecture Architecture,
    os.name AS os_name,
    os.base_version os_base_version,
    os.update_level os_update_level,
    os.address_length_in_bits os_address_length_in_bits
    FROM mgmt_targets t, mgmt_ecm_snapshot s, mgmt_hc_os_summary os, MGMT_HC_HARDWARE_MASTER hw
    WHERE t.target_type = 'host'
    AND t.target_name = s.target_name
    AND s.snapshot_type = 'host_configuration'
    AND s.target_type = 'host'
    AND s.is_current = 'Y'
    AND s.snapshot_guid = os.snapshot_guid
    AND hw.snapshot_guid = s.snapshot_guid
    ORDER by t.target_type
    The asked info is available in the view MGMT_HC_HARDWARE_MASTER, column: SYSTEM_CONFIG
    Eric

  • 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 I find my iphone from my imac off.   hvordan jeg finder min iphone fra min imac af?

    hej jeg står og mangler hjælp til hvordan jeg finder min iphone fra min imac af?
    hello I'm standing and need help with how I find my iphone from my imac off?

    Import photos and videos from your iPhone, iPad, or iPod touch to your Mac or Windows PC - Apple Support

  • How to find max(time) from table using group by

    how to find max(time) from table using group by
    select var max(time)
              from table
              into (var1, time1)
               where .....
                 group by var.
    it is fetching record which is top in table.
    if u can help?
    regards.

    No this will fetch the maximum time from teh table.
    select var max(time)
    from table xxxx
    into (var1, time1)
    where .....
    group by var.
    Refer this code
    TABLES SBOOK.
    DATA:  COUNT TYPE I, SUM TYPE P DECIMALS 2, AVG TYPE F.
    DATA:  CONNID LIKE SBOOK-CONNID.
    SELECT CONNID COUNT( * ) SUM( LUGGWEIGHT ) AVG( LUGGWEIGHT )
           INTO (CONNID, COUNT, SUM, AVG)
           FROM SBOOK
           WHERE
             CARRID   = 'LH '      AND
             FLDATE   = '19950228'
           GROUP BY CONNID.
      WRITE: / CONNID, COUNT, SUM, AVG.
    ENDSELECT.

  • How to find lost files from Iphone without back up

    How to find lost files from iPhone without back up?

    If you don't have a back up, there's no where to restore them from.

  • How to read characters from a string ?

    Hi,
    In my java program I accepted string from the user and now I want to calculate the length of the string, and then read characters one by one to encrypt it.
    How to read the characters one by one ? Like Mid$ function in VB.
    Small code to illustrate will be appreciated.

    Hi,
    Pick one!
    public class A
      public static void pokeAtString( String s )
        for( int i = 0; i < s.length(); ++i )
          System.out.print( s.charAt( i ) );
      public static void useCharArray( String s )
        char[] c = s.toCharArray();
        for( int i = 0; i < c.length; ++i )
          System.out.print( c[i] );
      public static void main( String[] args )
        String s = "Once was a good man.";
        System.out.print( "PokeAtString: " );
        pokeAtString( s );
        System.out.print( "\nuseCharArray: " );
        useCharArray( s );
        System.out.println( "" );
    }Enjoy,
    Manfred.

  • How can I find special characters in a string

    Hi,
    I have a small task where I have to find special characters in a given string, Can anyone suggest.......................

    What is your definition of a "special character", could you be a bit more specific?
    Do you simply want to find the position of a specific character in the string?
    Can it occur more than once and you want to find all occurences?
    What should happen if the special character does not exist?
    For programming purposes, all 256 possible 8 bit characters (x00-xFF) can be treated the same. Non-printing characters can be entered in \-codes or hex display if needed.
    LabVIEW Champion . Do more with less code and in less time .

  • How can I remove all non alpha/space characters from a string

    Subject changed by moderator.  Please use a meaningful subject in future.
    Hi all,
    Can anyone tell me.
    how to get only alphabets & spaces from the string..
    suppose..
    raj*&{]afhajk ajkf_+#fkh jah jka7767jk hhha
    I need only
    rajafhajk ajkf fkh jah jkajk hhha
    thanks..
    Rajeev
    Edited by: Matt on Feb 17, 2009 3:36 PM

    This will work.
    CONSTANTS:
      sm2big(52) VALUE
        'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'.
    DATA:
      str_out(60),
      str_in(60) VALUE
      'raj*&{]afhajk ajkf_+^#^fkh jah jka7767jk hhha',
      my_len          TYPE i,
      pos1            TYPE i,
      pos2            TYPE i.
    START-OF-SELECTION.
      COMPUTE my_len = strlen( str_in ).
      CLEAR pos1.
      CLEAR pos2.
      WHILE pos1 LT my_len.
        IF str_in+pos1(1) co sm2big
        OR str_in+pos1(1) EQ ' '.
          str_out+pos2(1) = str_in+pos1(1).
          pos2 = pos2 + 1.
        ENDIF.
        pos1 = pos1 + 1.
      ENDWHILE.
      WRITE:/ 'String In', str_in.
      WRITE:/ 'String Out', str_out.
    and the output
    String In      raj*&{]afhajk ajkf_+^#^fkh jah jka7767jk hhha
    String Out   rajafhajk ajkffkh jah jkajk hhha            

Maybe you are looking for

  • ITunes thinks that my iPad was never set up

    I recently got a retina display iPad. I set this up out of the box, using the iPad's quick start, product registration, etc. This iPad -- which is fully set up and functional -- will not successfully interface with iTunes. Attempting to sync the iPad

  • Can't Find Photo Booth

    Hi. I just installed iLife 08 and it seems that Photo Booth has disappeared. Any ideas how I can get it back? I am running 10.4.11.

  • My photos have disappeared from iPhoto 11

    My hard drive was replaced at the beginning of this year by apple because of the possibility of premature failure. Just before Christmas 2013, i discovered my iPhoto was blank. sometime in January, the photos all reappeared but as of yesterday, they

  • Quality issues with Compressor 3

    We have recently received a Mac Pro Tower and Final Cut Studio 2... this is an upgrade, however compressor's quality seems to be a downgrade. We deal with mainly HDV content and use the H264 codec, however using the same parameters/settings, the olde

  • Help My site is missing after publishing changes

    I created a site to replace a previously created one already on a server. I first deleted the existing one on the server. I published my new site to the desktop then used Fetch to upload it. Everything was fine, but some changes needed to be made. I