# GrapeCity.Documents.Common.Unit.StringToUnitType

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Common_Unit_StringToUnitType_" data-uid="GrapeCity.Documents.Common.Unit.StringToUnitType*">StringToUnitType Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Common_Unit_StringToUnitType_" data-uid="GrapeCity.Documents.Common.Unit.StringToUnitType*"></a>
<h4 id="GrapeCity_Documents_Common_Unit_StringToUnitType_System_String_GrapeCity_Documents_Common_UnitTypeEnum__" data-uid="GrapeCity.Documents.Common.Unit.StringToUnitType(System.String,GrapeCity.Documents.Common.UnitTypeEnum@)">StringToUnitType(string, ref UnitTypeEnum)</h4>
<div class="markdown level1 summary"><p>Converts a string to a <a class="xref" href="GrapeCity.Documents.Common.UnitTypeEnum.html">UnitTypeEnum</a> value. The string can be one of the following:
&quot;doc&quot;, &quot;in&quot;, &quot;mm&quot;, &quot;pc&quot;, &quot;dsp&quot;, &quot;pt&quot;, &quot;tw&quot;, &quot;inhs&quot;, &quot;cm&quot;, &quot;dip&quot;.
This method is case-insensitive.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static bool StringToUnitType(string s, ref UnitTypeEnum value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function StringToUnitType(s As String, ByRef value As UnitTypeEnum) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">s</span></td>
      <td><p>The string to convert.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Common.UnitTypeEnum.html">UnitTypeEnum</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>OUT: On exit, contains the <a class="xref" href="GrapeCity.Documents.Common.UnitTypeEnum.html">UnitTypeEnum</a> value.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p><b>true</b> if no error occurred, <b>false</b> otherwise.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
