code: private String assignProperties(String str) {
          int propertyIndexStart = 0, propertyIndexEnd = 0;
          boolean requireProperty;
          String result = "";
  
          while (propertyIndexStart < str.length()) {
              {
                  int i1 = str.indexOf("${", propertyIndexStart);
                  int i2 = str.indexOf("!{", propertyIndexStart);
                  if (i1 == -1) {
                      propertyIndexStart = i2;
                  } else if (i2 == -1) {
                      propertyIndexStart = i1;
                  } else {
                      propertyIndexStart = Math.min(i1, i2);
                  }
                  requireProperty = propertyIndexStart == i2;
              }
              if (propertyIndexStart == -1) break;
              result += str.substring(propertyIndexEnd, propertyIndexStart);
  
              propertyIndexEnd = str.indexOf("}", propertyIndexStart);
              if (propertyIndexEnd == -1) break;
  
              String propertyKey = str.substring(propertyIndexStart + 2, propertyIndexEnd);
              String propertyValue = System.getProperty(propertyKey);
              // assume properties contain paths
              if (propertyValue == null) {
                  if (requireProperty) {
                      throw new IllegalArgumentException("Variable " + propertyKey + " in groovy-starter.conf references a non-existent System property! Try passing the property to the VM using -D" + propertyKey + "=myValue in JAVA_OPTS");
                  } else {
                      return null;
                  }
              }
              propertyValue = getSlashyPath(propertyValue);
              propertyValue = correctDoubleSlash(propertyValue, propertyIndexEnd, str);
              result += propertyValue;
  
              propertyIndexEnd++;
              propertyIndexStart = propertyIndexEnd;
          }
  
          if (propertyIndexStart == -1 || propertyIndexStart >= str.length()) {
              result += str.substring(propertyIndexEnd);
          } else if (propertyIndexEnd == -1) {
              result += str.substring(propertyIndexStart);
          }
  
          return result;
      }
docs: /*
  Expands the properties inside the given string to it's values.