修剪Android中的字符串

时间:2016-06-23 14:10:10

标签: java android string textview trim

我有一个字符串"A.B.G[FULL] - 550RS",我只想将字符串中的550值转换为另一个textview。更具体地说,我想要MultiAutoCompleteTextView,其中可能包含3个项目,例如"A.B.G[FULL] - 550RS""A.B.G[SHORT] - 550RS""ACE LEVEL - 850RS"。所以最终我希望进一步加强550550850,我想添加这些数字并在其他edittext中显示结果。

register_main.java

package com.example.spand.krishnasoftwares;


public class register_main extends content_main implements AdapterView.OnItemSelectedListener {
    Button register;
    EditText patient_name, date, age, contact_number, ref_by, email;
    RadioButton male, female, nb;
    TextView gender;
    MultiAutoCompleteTextView MultipleValuesholdt;



public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.register_main);

    date = (EditText) findViewById(R.id.edt_date);
    SimpleDateFormat dateF = new SimpleDateFormat("EEE, d MMM yyyy", Locale.getDefault());
    String datea = dateF.format(Calendar.getInstance().getTime());
    date.setText(datea);

    patient_name = (EditText) findViewById(R.id.edt_ptn);

    age = (EditText) findViewById(R.id.edt_age);

    contact_number = (EditText) findViewById(R.id.edt_cno);

    ref_by = (EditText) findViewById(R.id.edt_dr);

    email = (EditText) findViewById(R.id.edt_mail);

    male = (RadioButton) findViewById(R.id.rb_male);

    female = (RadioButton) findViewById(R.id.rb_female);

    nb = (RadioButton) findViewById(R.id.rb_nb);

    gender = (TextView) findViewById(R.id.tv_gender);

    register = (Button) findViewById(R.id.button_reg);



    // Spinner element
    Spinner spinner = (Spinner) findViewById(R.id.spinner);

    // Spinner click listener
    spinner.setOnItemSelectedListener(this);

    // Spinner Drop down elements
    List<String> categories = new ArrayList<String>();
    categories.add("Years");
    categories.add("Months");
    categories.add("Days");

    // Creating adapter for spinner
    ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, categories);

    // Drop down layout style - list view with radio button
    dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

    // attaching data adapter to spinner
    spinner.setAdapter(dataAdapter);

    //-----------------------------------------------------------------------------------

    String[] MultipleTextStringValue = { "A.B.G[FULL] - 550RS","A.B.G[SHORT] - 550RS","ACE LEVEL - 850RS","ACETONE (SERUM) - 140","ACID PHOSPHETASE - 300RS","ACUTE LEUKEMIA IMMUNOPHENO LYPINS - 6800RS","ADA - 400RS","ADVANCE PROFILE(D.H.H.C) - 1930RS","AEC:Absolute Eosinophil Count - 100RS","AFB - 150RS",
    "AFB FOR LEPRA BACILLI: EAR LOBE - 200RS","AFB X 2 - 300RS","AFB X 3 SAMPLE - 450RS","ALBERT STAIN FOR DEPHTHERIYA - 350RS","ALBUMIN - 100RS","ALFA FETOPROTEIN (AFP) - 500RS","ALKPO4 - 140RS","ALKPO4: Alkaline Phosphatase - 140RS","ALLERGY PROFILE (SDC) - 2000RS","ALLERGY PROFILE: COMPLETE VEG - 2400RS",
    "ALLERGY PROFILE: COMPLETE VEG & NON-VEG - 3400RS", "ALLERGY PROFILE: VEG & NON-VEG - 3000RS","AMMONIA - 450RS","AMYLASE - 350RS", "AMYLASE BY DT - 350RS","ANA (BLOCK PROFILE) - 2500RS","ANA ACA & APLA - 2150","ANA IMMUNOFLORANCE - 790","ANA PROFILE-SDC - 2800RS", "ANAEROBIC CULTURE - 950",
    "ANC:Absolute Neutrophil Count - 100RS","ANCA(P&C) - 1250RS","ANCA-C - 630RS","ANCA-P - 350RS","ANEMIA PRFL (CBC,FE,TIBC,R.C,VITB12,FER) - 1600","ANTI ACH RECEPTOR ANTIBODY - 3500RS","ANTI DN BASE-B LEVEL - 950RS","ANTI DS DNA - 900RS","ANTI GBM ANTIBODY - 1300RS","ANTI HBC ANTIBODY Ig M - 770RS"
    ,"ANTI HBEAG - 350RS","ANTI HBe ANTIBODY - 650RS","ANTI HBeAG AT OTHER - 650RS","ANTI HBs ANTIBODY - 750RS","ANTI HBsAg TITRE - 700RS","ANTI LKM AB - 1000RS","ANTI MEASLES ANTI BODY IgM - 750RS","ANTI MEASLES ANTIBODY IGG - 750RS","ANTI MITOCHONDIAL ANTIBODY - 1100RS","ANTI PHOSPHOLIPID ANTIBODY IgG, IgM - 1350RS",
    "ANTI R. ANTI BODY - 1200RS","ANTI RO LA - 2700RS","ANTI TB Ig A - 300RS","ANTI TB Ig G - 300RS","ANTI TB Ig M - 300RS","ANTI THYROGLOBULIN ANTIBODY - 950RS","ANTI THYROID ANTIBODY - 550RS","ANTI U,RNP ANTIBODY - 1200RS","ANTITHROMBIN-III - 2500RS",
   "APLA LA& ACA - 1200RS","APTT-2 - 500RS","ART PROFILE(FASTING) - 4780RS","ART PROFILE(RANDOM) - 4330RS","ARTERIAL AMMONIA LEVAL - 450RS","ASCA - 1600RS","ASO TITRE - QUANTITATIVE - 350RS","Anti phospholipid antibody (APLA): Abha - 1350RS","BETA HCG - 550RS",
    "BICARBONATE[HCO3] - 350RS","BILIRUBIN - 180RS","BILIRUBIN (B/O) - 180RS","BIOPSY - 900RS","BIOPSY APPENDIX - 390RS","BIOPSY D&C - 500RS","BIOPSY LARGE - 1500RS","BIOPSY MEDIUM - 900RS","BIOPSY RADICAL - 200RS","BIOPSY SMALL - 700RS",
    "BIOPSY: I.H.C. DEPOSIT - 4500RS","BLEEDING TIME - 50RS","BLOOD CULTURE - 1RS","BLOOD GROUPING & RH TYPING - 100RS","BLOOD PH - 150RS","BONE MARROW - 800RS","BONE MARROW PROCEDURE - 300RS","BRUCELLOSIS - 550RS","BT,CT - 100RS","BT,CT & APTT - 350RS",
    "BT,CT & PT - 300RS","BT,CT,PT & APTT - 550RS","BUN - 140RS","BUN:CREATININE RATIO - 200RS","C/S : BACTERIOLOGIAL - 1RS","C/S BLOOD - 1RS","C/S BLOOD DR. VIJAYBHAI - 100RS","C/S: BLOOD - 500RS","C/S: FUNGAL - 550RS","C/S:BACTERILOGICAL - 500RS",
            "CA 19.9 - 800RS","CA-125 - 800RS","CALCIUM - 180RS","CARBAMEZAPINE LEVEL - 400RS","CARDIAC RISK MARKER - 1800RS","CBC MP PLT INDICES - 280RS","CBC PLT INDICES ESR - 300RS","CBC PS PLT ESR - 270RS","CBC RUN - 100RS","CBCMPPLT - 220RS",
    "CD4 CD8(S D C) - 1500RS","CD4CD8 - 1200RS","CEA - 550RS","CHIKUNGUNIYA IgM - 500RS","CHLORIDE - 150RS","CHOLESTEROL - 150RS","CHOLESTEROL BY DT - 150RS","CHOLINESTERASE BY DT - 450RS","CLEARANCE TEST - 250RS","COAGLULATION[FULL: S+FIRBINO+FDP - 1840RS",
    "COAGULATION[SHORT:BT CT PT APTT] - 440RS","CONJACTIVAL SWAB - 150RS","COOMBS TEST(DCT & ICT) - 550RS","COOMBS TEST: DCT - 250RS","COOMBS TEST: ICT - 350RS","CORTISOL - 550RS","CPK - 300RS","CPK BY DT - 300RS","CPK&CPK-MB - 650RS","CPK-MB - 450RS",
    "CREATININE BY DRY CHEMISTRY - 140RS","CRP: QUANTITATIVE TEST - 300RS","CRP: [B/O NEONATES] - 300RS","CRYPTOCOCCAL ANTIGEN - 800RS","CSF - 550RS","CSF FOR AQUA P4 ANTIBODY FOR NMOI - 3600RS","CSF FOR JAPANASE ENCEPH VIRAL STUDY - 4000RS","CSF HSV 1 & 2 - 2700RS","CSF MICROPROTEIN - 120RS","CSF OLIGOCLONAL BAND IGG - 3000RS","CSF-ADA - 400RS",
            "CSF-ANTI MEASELES TITRE - 1800RS","CSF-VDRL - 150RS","CT - 50RS","CULTURE & SENS: AFB (5 DRUGS) - 1000RS","CYTOLOGY SEMEN - 800RS","CYTOLOGY - FLUID - 800RS","DENGUE ELISA(G +M) - 1000RS","DENGUE RAPID (IgM ) - 400RS","DENGUE ELISA (G+M ) - 1000RS",
    "DENGUE ELISA (NS1 ) - 700RS","DENGUE ELISA DUO - 1500RS","DENGUE ELISA IGG - 600RS","DENGUE ELISA IGM - 600RS","DENGUE RAPID - 900RS","DENGUE RAPID (G +M ) - 650RS","DENGUE RAPID (G+M+NS1) - 900RS","DENGUE RAPID IGG - 500RS","DENGUE RAPID IGM - 500RS","DENGUE RAPID NS1 - 550RS",
            "DHEAS (FEMALE) - 550RS","DISPOSIBILE SYRINGE & NEEDLE SET - 5RS","DOUBLE MARKER(BETA HCG,PAPA-A) - 1300RS","E/T ROUTINE - 200RS","EAR SWAB R/M - 300RS","EBV IG M - 1000RS","ELECTROLYTE - 400RS","ELECTROLYTE OF URINE - 400RS","ELECTROPHORESIS OF LIPID - 700RS","ELECTROPHORESIS OF PROTEIN - 700RS","ELISA: CYSTICARCAL ANTIBODY - 1350RS","EMERGENCY CHARGE - 190RS","ENDOMETRIAL BIOPSY FOR TB -PCR - 1650RS",
            "ENTAMOEBA HISTOLYTICA SEROLOGY - 900RS","EPTOIN LEVEL - 500RS","ER+PR - 2000RS","ER/PR/HER2 - 2650RS","ESR - 100RS","ESTIMATION OF URINE ELECTROLYTES - 300RS","ESTRADIOL (FEMALE) - 330RS","ESTRADIOL (MALE) - 330RS","FACTOR XIII (UREA CLOT SOLUBILITY TEST) - 200RS","FBS - 30RS","FDP-D DIMER - 1000RS","FERRITIN - 550RS","FIBRINOGEN - 600RS","FLUID ALBUMIN - 100RS","FLUID AMYLASE - 350RS","FLUID GLUCOSE & PROTEIN - 130RS","FLUID ROUTINE AND MICRO - 550RS",
    "FNAC - 900RS","FOLIC ACID (FOLATE) - 750RS","FREE T3 - 200RS","FREE T4 - 200RS","FREGMENTED RBC - 100RS","FROZEN SECTION STUDY - 900RS","FSH FEMALE - 350RS","FSH MALE - 350RS","FUNGAL STAIN - 200RS","FUNGAL STAIN - 300RS","G6PD (QUALITATIVE) - 250RS",
    "G6PD (QUANTITATIVE) - 350RS","GARDINAL LEVEL - 550RS","GENE EXPERT FOR TB - 250RS","GGTP - 350RS0","GGTP BY DT - 350RS","GLYCOSYLATED HB/Hb A1C - 400RS","GRAM STAIN - 150RS","GRAM STAIN & Z.N.STAIN - 250RS","GROWTH HORMONE(GH) - 590RS",
            "GTT-3 SAMPLE - 150RS","GTT-5 SAMPLE - 250RS","H.I.V -SCREEN - 350RS","HAEMOPHILIA FACTOR 8 - 1100RS","HAEMOPHILIA FACTOR 9 - 1100RS","HANTA - IgM - 990RS","HAV RAPID IgM - 750RS","HB - 100RS","HB, RBC COUNT - 120RS","HB,PCV - 120RS",
    "HB,RBC INDICES - 100RS","HBTCDC - 150RS","HBsAg ELISA - 350RS","HBsAg RAPID - 200RS","HCV RAPID - 450RS","HCV RAPID - 450RS","HCV REPID - 450RS","HCV(ELISA) - 550RS","HDLCHOL - 300RS","HDLCHOLE BY DT - 300RS",
    "HERPES2 IGM - 300RS","HERPES2 IgG - 300RS","HEV ELISA IgM - 900RS","HEV RAPID IGM - 700RS","HEV RAPID IgM - 700RS","HIV ELISA - 450RS","HIV RAPID - 450RS","HIV: VIRAL LOAD & CD4-CD8 COUNT - 5000RS","HOMOCYSTINE - 800RS","HS CRP (ULTRA SENSITIVE) - 450RS","HsCRP (ULTRA SENSITIVE) - 450RS",
    "IGE LEVEL - 400RS","IMMUNO FIXATION - 5500RS","IMMUNO HISTOCHEMISHTRY - 2500RS","INDIA INK PREPRATION - 50RS","IONISED CALCIUM - 250RS","IRON - 300RS","IgM ANTI HBC ANTIBODY - 600RS","KARYOTYPING - 2200RS","KOH EXAMINATION SMEAR - 200RS","L&T - 50RS","L..E.CELL - 150RS",
    "LACTATE - 450RS","LCDC PROFILE - 100RS","LDH - 350RS","LDH BY DT - 350RS","LDL - 250RS","LEAD - 1300RS","LEPTO IGM - 660RS","LEPTO IgM RAPID - 450RS","LFT(Bili,Sgot,Sgpt,Prot,AlKPO4,PT-INR) - 800RS","LH-FEMALE - 350RS","LH-MALE - 350RS","LIPASE - 450RS","LIPID PROFILE[PARTIAL] - 450RS","LIPID PROFILE WITH APOA1&APOB - 750RS","LIPOPROTEIN (a) [Lp(a)] - 600RS","LITHIUM - 350RS","LUPUS ANTICOAGULANT - 800RS",
    "MAGNESIUM - 350RS","MALARIA ANTIGEN[PVPF] - 300RS","MALARIAL ANTIBODY - 300RS","MCV - 80RS","MEASLES-SDC - 500RS","MERCURY LEVEL - 3300RS","MICRO PROTEIN - 120RS","MICROFILARIA - 250RS","MILK SECRETION R/M - 200RS","MINI THROMBOPHILIYAPROFILE HOMO-D - 9500RS","MMR TITRE - 1500RS","MP - 100RS","MP ESR - 120RS","MP PLT - 120RS","MT - 100RS","MUMPS IGG-IGM-SDC - 500RS","NBILBY DT AD+dEEP - 30RS","NMO Antibody - 4500RS","ORAL SECRETION RM - 200RS","OSMOLARITY-SDC - 600RS",
    "OSMOTIC FRAGILITY - 250RS","P.T.T.K - 200RS","PAP SMEAR - 400RS","PARITONEAL FLUID - 500RS","PCR FOR TB - 1550RS","PCV - 70RS","PEPTIDE - 700RS","PERASITE INDEX - 100RS","PERICARDIAL FLUID ROUTINE & MICRO - 500RS","PERIPHERAL SMEAR - 200RS","PH(ABG,VBG,URINE) - 150RS","PHOSPHORUS - 120RS","PLASMA ALDOSTERONE - 2300RS","PLASMA RENIN ACTIVITY(PRA) - 3600RS","PLATELET COUNT - 100RS",
    "PLETLET-PCV - 130RS","PLEURAL FLUID ROUTINE MICRO - 500RS","PNH - 950RS","POTASSIUM - 120RS","PPBS - 30RS","PRE OP BHAVIN BHUVA - 1100RS","PRE OP(MINOR)-GNP - 820RS","PRE OP.(J.S.N) MINOR - 710RS","PRE OP.(MAJOR)-GNP - 1100RS","PRE OP.(MAJOR)-JSN - 1000RS","PRE OPERATIVE PROFILE - 1500RS","PROCALCITONIN (PCT) - 1600RS","PROCALCITONIN LEVEL - 1600RS","PROGESTERONE FEMALE - 400RS","PROLACTIN FEMALE - 300RS","PROLACTIN MALE - 300RS","PROTEIN - 150RS","PROTEIN BY DT - 150RS","PROTEIN IMMUNOELECTROPHORESIS - 4500RS","PRP FOR IMPLANT - 200RS",
    "PSA - 500RS","PT - 170RS","PT,APTT - 370RS","PT,APTT & FIBRINOGEN - 870RS","PTH AT SDC - 750RS","PUS R/M - 200RS","PYRIDOXINE LEVEL - 2400RS","Pneumocystic Carini in Sputum - 250RS","Processing charges - 50RS","RA [RF] QUANTATIVE - 250RS","RBC INDICES - 50RS","RBS - 30RS","RBS (B/O) - 50RS","RBS BY DT - 50RS","RETICULOCYTE COUNT - 100RS",
    "RFT(UR/CRT/PROT/ELECTROLYTE) - 550RS","RUBELLA IGG+IGM-SDC - 240RS","SALMONELLA ANTIGEN - 300RS","SEMEN EXAMINATION - 200RS","SENSITIVITY-DRUG - 1000RS","SGOT - 140RS","SGOT BY DT - 140RS","SGPT BY DT - 140RS","SICKLING TEST - 150RS","SIMULTENEOUS RBS - 30RS",
    "SKIN SCRAPPING FOR LEPRAE (HENSEN) - 300RS","SMOOTH MUSLE ANTIBODY (S.L.E TEST) - 1200RS","SODIUM - 120RS","SPCIFIC GRAVITY FOR URINE - 50RS","SPUTUM R/M - 200RS","STONE ANALYSIS - 700RS","STOOL FOR CL. DIFFICILE ANTIGEN - 1800RS","STOOL FOR OCCULT BLOOD - 50RS","STOOL HANGING DROP - 100RS","STOOL R/M REDUCING SUBSTANE - 130RS","SUCROSE LYSIS - 250RS","Salmonella Antigen - 300RS",
    "T.B. PCR - 1790RS","T3 - 180RS","T3 (B/O) - 180RS","T3,T4 - 300RS","T3,T4,TSH (B/O) - 400RS","T3TSH - 300RS","T4 - 180RS","T4 (B/O) - 180RS","T4TSH - 300RS","TB IgA - 400RS","TB IgG - 400RS","TB IgM - 400RS","TB IgM,IgG,IgA - 1000RS","TC - 80RS","TC DC - 120RS","TC DC ESR - 150RS","TC ESR MP - 150RS","TC INDICE ESR - 180RS","TC PLET ESR - 140RS","TCESR - 120RS","TCMP PLAT - 150RS","TCMPPLETESR - 160RS","TCMPPLETESR&INDICES - 180RS","TCMPPLT&INDICES - 180RS","TCPLAT - 120RS","TCPLTPCV(HCT) - 150RS",
    "TESTOSTERON MALE - 300RS","TESTOSTERON FEMALE - 300RS","TESTOSTERONE FREE - FEMALE - 800RS","TESTOSTERONE FREE- MALE - 800RS","THROAT SWAB R&M - 350RS","THYROGLOBULIN - 1000RS","THYROID ANTIBODY - 400RS","THYROID ANTIBODY - 400RS","TIBC - 300RS","TORCH TEST - 2000RS","TORCH TEST AT SDC - 1800RS","TOTAL Ig E - 400RS","TOXOPLASMA IGM - 300RS","TPHA - 400RS","TPHA1 - 100RS","TRIGLICERIDE BY DT - 120RS","TRIGLYCERIDE - 120RS","TRIPLE TEST - 1980RS","TRIPONIN-I - 950RS","TRIPONIN-T - 950RS","TROPONIN-T -QUANTITATIVE- 950RS","TROPONINE-T - 950RS","TSH - 200RS",
    "TSH[B/O] - 200RS","TYPHI DOT Ig M - 200RS","TYPHI DOT IgG - 200RS","TYPHI DOT IgG+M - 300RS","Toxoplasma Igg+IgM - 600RS","UPT - 150RS","UREA BY DT - 140RS","UREA CLEARANCE TEST - 350RS","URETHRAL SMEAR EXAMINATION - 200RS","URIC ACID BY DT - 140RS","URINARY AMINO LEVULENIC ACID - 1550RS","URINARY FeNa - 490RS","URINE - OSMORALITI - 400RS","URINE 24 HOURS ALBUMIN - 150RS","URINE 24 HOURS PROTEIN - 150RS","URINE ACETONE - 30RS","URINE ALBUMIN - 30RS","URINE AMINOACID - 500RS",
    "URINE BENCE JONES PROTEIN - 150RS","URINE BS BP - 50RS","URINE CALCIUM - 150RS","URINE CREAT - 120RS","URINE ELECTROLYTE - 300RS","URINE EXAMINATION FOR METABOLIC - 1800RS","URINE FOR ALA - 1700RS","URINE FOR BETA HCG - 150RS","URINE FOR CHYLOMICRON - 150RS","URINE FOR EOSINOPHILS - 100RS","URINE FOR HAEMOGLOBINURIA - 150RS","URINE FOR PKU - 120RS","URINE FOR RBC - 30RS","URINE FOR REDUCING SUBSTANCE - 150RS","URINE HAEMOSIDERIN - 120RS","URINE METABOLITES (PH,CALCI,PHOS,U.A) - 360RS","URINE MICRO ALBUMIN - 350RS","URINE MYOGLOBIN - 300RS",
            "URINE OXALATE ( 24 HRS.URINE) - 1000RS","URINE PH - 50RS","URINE PHOSPHATE - 150RS","URINE PORBHOBILINOGEN - 120RS","URINE POTASSIUM - 120RS","URINE PREGNANCY TEST - 150RS","URINE SODIUM - 120RS","URINE SODIUM:CREATININE RATIO - 350RS","URINE SUGAR - 30RS","URINE SUGAR-ACETONE - 30RS","URINE T.B PCR - 2000RS","URINE TEST FOR CHYLURIA - 150RS","URINE UREA - 120RS","URINE-CALCIUM:CREATININE RATIO - 350RS","URINE-CREATININE:BUN RATIO - 350RS","URINE-PROTEIN: CREATININE RATIO - 400RS","URINER/M - 100RS","Urine for Creati/ Urinc acid Ratn - 350RS",
            "VACUTAINER - 10RS","VACUTAINER [2X10] - 20RS","VACUTAINER [3X10] - 30RS","VACUTAINER[4 X10] - 40RS","VACUTAINER[5 X10] - 500RS","VALPROIK ACID - 600RS","VBG - 400RS","VDRL TEST - 150RS","VISIT AT HOME - 50RS","VISIT AT HOME - 100RS","VISIT CHARGE - 40RS","VIT-D3 - 1000RS","VITAMIN B12 - 500RS","VON WILLEBRAND ASSAY - 1800RS","WATER TEST(SMC&BORING) - 2000RS","WEIL FELIX TEST FOR RICKETTSIA - 500RS","WESTERN BLOTT(SDC) - 2000RS","WIDAL TEST - 130RS","XYZ -500RS","Z.N.STAIN - 100RS","ZINC - 700RS","fluid gene-xpert TB -MICROCARE - 2000RS"};
    MultipleValuesholdt = (MultiAutoCompleteTextView)findViewById(R.id.tv_test);
    ArrayAdapter<String> TopicName = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, MultipleTextStringValue);
    MultipleValuesholdt.setAdapter(TopicName);
    MultipleValuesholdt.setThreshold(3);
    MultipleValuesholdt.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
}

    @Override
    public void onClick (View view){

    }

    @Override
    public void onItemSelected (AdapterView < ? > adapterView, View view,int i, long l){

    }

    @Override
    public void onNothingSelected (AdapterView < ? > adapterView){

    }
}

Just view the image for getting better idea.

感谢。我希望得到帮助。 [1]

4 个答案:

答案 0 :(得分:0)

String texts = "A.B.G[FULL] - 550RS, A.B.G[SHORT] - 550RS, ACE LEVEL - 850RS";
String[] spitStr= texts.split(",");
String numberOne    = spitStr[0].replaceAll("[^0-9]", "");
String numberSecond = spitStr[1].replaceAll("[^0-9]", "");
String numberThird  = spitStr[2].replaceAll("[^0-9]", "");

create or replace TRIGGER AUDIT_DDL_TRIGGER AFTER ddl or ALTER OR RENAME ON schema
DECLARE
BEGIN
   send_mail(p_to        => 'me@mycompany.com',
             p_from      => 'admin@mycompany.com',
             p_subject   => 'DDL!',
             p_message   => 'A DDL or ALTER or RENAME occurred.',
             p_smtp_host => 'smtp.mycompany.com');
END;  
/

答案 1 :(得分:0)

就是这个

String output;
for(int i=0; i < MultipleTextStringValue.length; i++){
    output = MultipleTextStringValue[i].replaceAll("[^0-9]", "");
    Log.d(TAG, "Output: " + output);
}

答案 2 :(得分:0)

如果只需要连字符后面的文字( - ),你可以使用它。

    String output;
        for(int i=0; i < MultipleTextStringValue.length; i++){
            String text = MultipleTextStringValue[i].substring(MultipleTextStringValue[i].lastIndexOf("-") + 1);
            output = text.replaceAll("[^0-9]", "");
            Log.d(TAG, "Output: " + output);
        }

答案 3 :(得分:0)

您可以考虑在&#34; - &#34;上分割字符串。角色,您也可以将其与其他解决方案一起使用:

    String[] splitString = MultipleTextStringValue.split("-");

结果:

    splitString = ["A.B.G[FULL] ", "- 550RS"];

所以你只能测试最后一个值:

    splitString[splitString.length - 1] = "- 550RS";

例如。 Click here代码为测试代码。