Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

stringtokenizer

How to find a whole word in a String in Java?

December 18, 2023 by Tarik

The example below is based on your comments. It uses a List of keywords, which will be searched in a given String using word boundaries. It uses StringUtils from Apache Commons Lang to build the regular expression and print the matched groups. String text = “I will come and meet you at the woods 123woods … Read more

Categories java Tags java, pattern-matching, string, stringtokenizer Leave a comment

AutoCompleteTextView backed by CursorLoader

December 7, 2023 by Tarik
Categories android Tags android, android-cursorloader, autocompletetextview, stringtokenizer Leave a comment

Performance of StringTokenizer class vs. String.split method in Java

July 29, 2023 by Tarik

If your data already in a database you need to parse the string of words, I would suggest using indexOf repeatedly. Its many times faster than either solution. However, getting the data from a database is still likely to much more expensive. StringBuilder sb = new StringBuilder(); for (int i = 100000; i < 100000 … Read more

Categories java Tags java, performance, stringtokenizer Leave a comment

Convert time value to format “hh:mm Am/Pm” using Android

May 14, 2023 by Tarik

Try this.. Date dt = new Date(date1); SimpleDateFormat sdf = new SimpleDateFormat(“hh:mm aa”); String time1 = sdf.format(dt);

Categories android Tags android, android-date, stringtokenizer Leave a comment

Why is StringTokenizer deprecated?

April 18, 2023 by Tarik

Java 10 String Tokenizer — not deprecated Java 9 String Tokenizer — not deprecated Java 8 String Tokenizer — not deprecated Java 7 String Tokenizer — not deprecated Java 6 String Tokenizer — not deprecated Java 5 String Tokenizer — not deprecated If it is not marked as deprecated, it is not going away.

Categories java Tags deprecated, java, split, string, stringtokenizer Leave a comment

Elasticsearch: Find substring match

March 5, 2023 by Tarik

To search for partial field matches and exact matches, it will work better if you define the fields as “not analyzed” or as keywords (rather than text), then use a wildcard query. See also this. To use a wildcard query, append * on both ends of the string you are searching for: POST /my_index/my_type/_search { … Read more

Categories autocomplete Tags autocomplete, elasticsearch, n-gram, stringtokenizer, substring Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa