Jump to content

programming logic help plz


usauae

Recommended Posts

8 minutes ago, ramudu said:

try this regex - ^[a-z]{1}[0-9]{3}$  (any a to z 1 char and followed by  3 numbers)  

thanks bro, that worked.

Regex ki practice ye na or yemi ain tips vuntaya ?

regex 101 website yeppudu aina avasaram vunte try chestha but I get confused

Link to comment
Share on other sites

4 minutes ago, dasari4kntr said:

VB...na

inka nadustunnaya..ee VB projects...?

Yemi cheppamantavu bro we still have vb, asp apps as old as 15 yrs

patch lu vesukuntu laagu chestunnam 

by the time I’m out of this job I will be super outdated too

Link to comment
Share on other sites

Just now, usauae said:

Yemi cheppamantavu bro we still have vb, asp apps as old as 15 yrs

patch lu vesukuntu laagu chestunnam 

by the time I’m out of this job I will be super outdated too

you mean classic asp 3.0 (not asp.net)…

if yes…its super outdated…

 

Link to comment
Share on other sites

29 minutes ago, MiryalgudaMaruthiRao said:

SpringBootGen ani undi Adena?

spring boot helper

this gives the boiler plate...

spring boot gen...helps you with autocomplete...

 

Link to comment
Share on other sites

2 hours ago, usauae said:

I have a list of strings that are always 4 characters  {'a001', 'aa01', 'aaa1', 'aaaa' }

I need to select only the ones that are  alph num num num ex: 'a001'

any ideas ?

import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Afdb {

    public static boolean isQualified(String str)
    {
        String reg = "^[a-zA-Z]{1}\\d{3}$";


        Pattern pattern = Pattern.compile(reg);

        if (str == null) {
            return false;
        }


        Matcher m = pattern.matcher(str);


        return m.matches();
    }

    public static void main(String[] args) {
        String[] myArray =  {"a001", "aa01", "aaa1", "aaaa","a0001" };

        Arrays.asList(myArray)
                .stream()
                .filter(element -> Afdb.isQualified(element))
                .map(element -> "string: " + element)
                .forEach(System.out::println);
    }
}
Link to comment
Share on other sites

4 minutes ago, csrcsr said:
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Afdb {

    public static boolean isQualified(String str)
    {
        String reg = "^[a-zA-Z]{1}\\d{3}$";


        Pattern pattern = Pattern.compile(reg);

        if (str == null) {
            return false;
        }


        Matcher m = pattern.matcher(str);


        return m.matches();
    }

    public static void main(String[] args) {
        String[] myArray =  {"a001", "aa01", "aaa1", "aaaa","a0001" };

        Arrays.asList(myArray)
                .stream()
                .filter(element -> Afdb.isQualified(element))
                .map(element -> "string: " + element)
                .forEach(System.out::println);
    }
}

Adhurs Helana GIF - Adhurs Helana Brahmi - Discover & Share GIFs

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...