Package com.logicaldoc.core.automation

# Class StringTool

java.lang.Object
com.logicaldoc.core.automation.StringTool

public class StringTool extends Object
Utility methods to handle strings

Since:
  9.0

## Constructor Summary

Constructors
Constructor
Description
`StringTool()`

## Method Summary

Modifier and Type
Method
Description
`String`
`defaultString(String str)`
Returns either the passed in String, or if the String is null, an empty String ("").
`String`
`defaultString(String str, String defaultStr)`
Returns either the passed in String, or if the String is null, the value of defaultStr.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### StringTool

public StringTool()

## Method Details

### defaultString

public String defaultString(String str)
Returns either the passed in String, or if the String is null, an empty String ("").

Parameters:
  `str` - the String to check, may be null
Returns:
  the passed in String, or the empty String if it was null

### defaultString

public String defaultString(String str, String defaultStr)
Returns either the passed in String, or if the String is null, the value of defaultStr.

Parameters:
  `str` - the String to check, may be null
  `defaultStr` - the default string to return if the input is empty ("") or null, may be null
Returns:
  the passed in String, or the empty String if it was null