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

  • SEARCH
  • Home
  • 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 7537623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:54:06+00:00 2026-05-30T06:54:06+00:00

In my properties file that I have for a mod I’m making for Minecraft

  • 0

In my properties file that I have for a mod I’m making for Minecraft I will need to have my properties file recognized certain words as being variables. These words will be contained like so: {variable name}

Here is an example of what might need to be parsed:

command01 = /ban {user} g {reason}  //This is read into the variable command1 only taking the things after the equals sign

{user} would be defined in an input box in the GUI. {reason} would also be as well.

{User} would equal the variable user which would be a String
{Reason} would equal the variable input1 which would be a String as well

Lets say the variable user holds the string “Fogest” and the input1 variable holds the string “He did xyz wrong”.

I essentially need to retrieve that value from the GUI which is already done, and then replace {User} and {Reason} with what those variables are equal to in the GUI.

After all my rambling the question is how would I go about parsing the string command1 to find placeholders such as {user} and {reason} and replace them with what the corresponding variable holds.

I hope this isn’t to confusing. If it just mention it in the comments and I will try and rephrase it.

  • 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-05-30T06:54:07+00:00Added an answer on May 30, 2026 at 6:54 am

    It looks like what you question boils down to is some kind of string substitution. I think what you’re looking for is something like this

    String someString = "We went to the {location}.";
    System.out.println(someString.replace("{location}", "store"));
    

    Running this code produces

    We went to the store.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a properties file, let say my-file.properties. In addition to that, I have
I have an executable jar Client.jar that requires jndi.properties file. Since the jndi properties
I have a words.txt file that I have put in a particular java package
We have a .properties file that has some values persisted as JSON. I keep
I am trying to generate a properties file for a mod I'm making for
I have a property in my Messages.properties file that has an argument that uses
In GWT, you can have a .properties file that lists key value pairs: foo
I have an application that uses a properties file that was added by hand
I have several classes that need to load some properties files, and I was
I have a properties file that says window.1.height=100 window.1.width=80 window.2.height=50 window.2.width=30 window.3.height=150 window.3.width=100 I

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.