Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8401755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:53:11+00:00 2026-06-09T21:53:11+00:00

I need to turn a string such as class freud IF : 0.010<=cst0.1<=0.02 ^

  • 0

I need to turn a string such as

class freud IF : 0.010<=cst0.1<=0.02 ^ 0.012<=cst0.2<=0.014 ^ 0.01<=cst0.3<=0.011 ^ 0.009<=cst0.4<=0.01 ^ cst0.5=0.009 ^ 0.008<=cst0.6<=0.009 ^ 0.008<=cst0.7<=0.009 ^ 0.007<=cst0.8<=0.009 ^ 0.007<=cst0.9<=0.009 ^ 0.008<=cst1.0<=0.012

into an actual Java if statement: i.e.

if(0.010 <= cst0.1 && cst0.1 <= 0.02 .....)

where cst0.1 becomes the name of a float etc.

Any ideas? I have tried splitting the string into its components, but all the strings I need vary!

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:53:13+00:00Added an answer on June 9, 2026 at 9:53 pm

    you can try create evaluate method boolean evaluate(String stringToEvaluate)
    wich will split your string on segments and evaluate each bit

    public class MyClass {
        public boolean evaluate(String stringToEvaluate)
        {
        boolean exprvalue = true;
        for (String string : stringToEvaluate.split("^"))
                {
                exprvalue = exprvalue && evaluateLE(string);
                }
        return exprvalue;
        }
    
        private boolean evaluateLE(String string) {
            String[] values = string.split("<=");
            if (values.length==2)
            {
                return evaluateVal(values[0]) <= evaluateVal(values[1]); 
            }
    
            return evaluateOtherLogicalExpr(string);
        }
    
        private float evaluateVal(String string) {
            if (isExpresion(string)) return evaluateArthmeticalExpr(string);
            if (isVariable(string)) return evaluateVariable(string);
    
            return Float.parseFloat(string);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to turn a string such as this: 'apple orange banana pear' into
I need to split a keyword string and turn it into a comma delimited
I have a user supplied string, that I then need to turn into a
I need to generate a Key from a string, such that I can always
I need to turn this phone number: 5555555555 into this string with delimiters: 555.555.5555
I need a simple string to sha256 generator class. I do not want to
I need to turn a query string like this: http://localhost/view.php?id=12345 Into this: http://localhost/12345 But,
I have a string aa::bb::aa and need to turn it in to aa, bb,
I have the following string coming in from users and need to turn it
I need to turn the string 125959 into 12:59:59 . Obviously, the string is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.