**Inheritance:**
java.lang.Object, com.aspose.pdf.dataeditor.CosPdfPrimitive com.aspose.pdf.dataeditor.CosPdfString, com.aspose.pdf.dataeditor.CosPdfPrimitive, com.aspose.pdf.dataeditor.CosPdfString

**All Implemented Interfaces:**
ICosPdfPrimitive

```
public final class CosPdfString extends CosPdfPrimitive
```

This class represents Pdf String object.

## Constructors

| Constructor | Description |
| --- | --- |
| [CosPdfString](#CosPdfString-java.lang.String-) | Initializes a new instance of the {@link CosPdfString} class. |
| [CosPdfString](#CosPdfString-java.lang.String-boolean-) | Initializes a new instance of the {@link CosPdfString} class. |

## Methods

| Method | Description |
| --- | --- |
| [equals](#equals-java.lang.Object-) | Determines that the specified object is equal to the current object. |
| [getValue](#getValue--) | Gets the string (ANSII). Value: The string. |
| [hashCode](#hashCode--) | Get hashcode for current object. |
| [isHexadecimal](#isHexadecimal--) | Gets a value indicating whether this instance is hexadecimal. Value: {@code true} if this instance is hexadecimal; otherwise, {@code false}. |
| [toCosPdfString](#toCosPdfString--) | Tries cast this instance to {@link CosPdfString}. |
| [toString](#toString--) | Returns a {@link String} that represents the current {@link CosPdfString}. |

### CosPdfString {#CosPdfString-java.lang.String-}
Initializes a new instance of the {@link CosPdfString} class.

### CosPdfString {#CosPdfString-java.lang.String-boolean-}
Initializes a new instance of the {@link CosPdfString} class.

### equals {#equals-java.lang.Object-}
Determines that the specified object is equal to the current object.

### getValue {#getValue--}
```
public final String getValue()
```

Gets the string (ANSII). Value: The string.

**Returns:**
String value

### hashCode {#hashCode--}
```
public int hashCode()
```

Get hashcode for current object.

**Returns:**
A hash code for current object.

### isHexadecimal {#isHexadecimal--}
```
public final boolean isHexadecimal()
```

Gets a value indicating whether this instance is hexadecimal. Value: {@code true} if this instance is hexadecimal; otherwise, {@code false}.

**Returns:**
boolean value

### toCosPdfString {#toCosPdfString--}
```
public CosPdfString toCosPdfString()
```

Tries cast this instance to {@link CosPdfString}.

**Returns:**
null if instance is not {@link CosPdfString} else {@link CosPdfString}.

### toString {#toString--}
```
public String toString()
```

Returns a {@link String} that represents the current {@link CosPdfString}.

**Returns:**
A {@link String} that represents the current {@link CosPdfString}.
