Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manthanhd/super-string-java
Library for performing blazing fast string operations in Java.
https://github.com/manthanhd/super-string-java
Last synced: about 1 month ago
JSON representation
Library for performing blazing fast string operations in Java.
- Host: GitHub
- URL: https://github.com/manthanhd/super-string-java
- Owner: manthanhd
- Created: 2016-03-18T23:57:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-10T12:21:46.000Z (over 6 years ago)
- Last Synced: 2024-08-02T05:13:02.855Z (4 months ago)
- Language: Java
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-blazingly-fast - super-string-java - Library for performing blazing fast string operations in Java. (Java)
README
# Super String for Java
Library for performing blazing fast string operations in Java.## Overview
Super string works in two parts.1. Analysis
2. Operation### Analysis
When you create a super string object, analysis starts. Analysis will vary depending on number of operations super string supports. In case of replace, analysis part identifies all the tokens within the string that need replacing. If some analysis takes too long to run, it might do it lazily.### Operation
This is the part where you actually execute a method on an existing super string object. Because all the analysis has already been done on a string, this part is usually very quick. If you wanted super string to replace all labels in a string, this is the part where you do
```java
(new SuperString("Hello, :name:!")).replace(replaceValues);
```## Example usage
### Create a super string object.
Make this a field level, static object if you are going to execute replace on it more than once.
```java
final SuperString superString = new SuperString("one two three :afterThree: five :afterFiveIs:");
```### Create a hashmap of replace values.
```java
final Map superStringReplaceValues = new HashMap<>();
superStringReplaceValues.put("afterThree", "four");
superStringReplaceValues.put("afterFiveIs", "six");
```### Replace away!
```java
final String superStringReplacedString = superString.replace(superStringReplaceValues);
```