public class Misc extends Object
Constructor and Description |
---|
Misc() |
Modifier and Type | Method and Description |
---|---|
static String |
getFileName(String fullFileName) |
static String |
getFileNameNoSuffix(String f) |
static Coordinate |
getLineCharPosition(String s,
int index)
Given
index into string s , compute the line and char
position in line. |
static String |
getParent(String name) |
static String |
getPrefix(String name) |
static String |
join(Iterator<?> iter,
String separator) |
static boolean |
referenceEquals(Object x,
Object y)
Makes it clear when a comparison is intended as reference equality.
|
static String |
replaceEscapedRightAngle(String s)
Replace >\> with >> in s.
|
static String |
replaceEscapes(String s) |
static String |
strip(String s,
int n) |
static String |
stripLastPathElement(String f)
Given, say,
file:/tmp/test.jar!/org/foo/templates/main.stg
convert to file:/tmp/test.jar!/org/foo/templates |
static String |
trimOneStartingNewline(String s)
Strip a single newline character from the front of
s . |
static String |
trimOneTrailingNewline(String s)
Strip a single newline character from the end of
s . |
static boolean |
urlExists(URL url) |
public static final String newline
public static boolean referenceEquals(Object x, Object y)
public static String trimOneStartingNewline(String s)
s
.public static String trimOneTrailingNewline(String s)
s
.public static String stripLastPathElement(String f)
file:/tmp/test.jar!/org/foo/templates/main.stg
convert to file:/tmp/test.jar!/org/foo/templates
public static String replaceEscapedRightAngle(String s)
public static boolean urlExists(URL url)
public static Coordinate getLineCharPosition(String s, int index)
index
into string s
, compute the line and char
position in line.Copyright © 2024. All rights reserved.