The API calculates the beginning offset of the content in the original
document according to the
[EncodingType][google.cloud.language.v1.EncodingType] specified in the API
request.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eTextSpan\u003c/code\u003e class is part of the Google Cloud Natural Language v1 API, representing a segment of text output.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of \u003ccode\u003eTextSpan\u003c/code\u003e is 3.7.0, with several previous versions available for reference, ranging back to 2.2.0.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTextSpan\u003c/code\u003e implements multiple interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class has two properties, \u003ccode\u003eBeginOffset\u003c/code\u003e, an integer representing the start position in the source text, and \u003ccode\u003eContent\u003c/code\u003e, a string for the text itself.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTextSpan\u003c/code\u003e has two constructors: a default constructor and a copy constructor that allows for creating a \u003ccode\u003eTextSpan\u003c/code\u003e object based on an existing \u003ccode\u003eTextSpan\u003c/code\u003e instance.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Natural Language v1 API - Class TextSpan (3.7.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.7.0 (latest)](/dotnet/docs/reference/Google.Cloud.Language.V1/latest/Google.Cloud.Language.V1.TextSpan)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Language.V1/3.6.0/Google.Cloud.Language.V1.TextSpan)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Language.V1/3.5.0/Google.Cloud.Language.V1.TextSpan)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Language.V1/3.4.0/Google.Cloud.Language.V1.TextSpan)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Language.V1/3.3.0/Google.Cloud.Language.V1.TextSpan)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Language.V1/3.2.0/Google.Cloud.Language.V1.TextSpan)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Language.V1/3.1.0/Google.Cloud.Language.V1.TextSpan)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Language.V1/3.0.0/Google.Cloud.Language.V1.TextSpan)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Language.V1/2.3.0/Google.Cloud.Language.V1.TextSpan)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Language.V1/2.2.0/Google.Cloud.Language.V1.TextSpan) \n\n public sealed class TextSpan : IMessage\u003cTextSpan\u003e, IEquatable\u003cTextSpan\u003e, IDeepCloneable\u003cTextSpan\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Natural Language v1 API class TextSpan.\n\nRepresents an output piece of text. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e TextSpan \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[TextSpan](/dotnet/docs/reference/Google.Cloud.Language.V1/latest/Google.Cloud.Language.V1.TextSpan), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[TextSpan](/dotnet/docs/reference/Google.Cloud.Language.V1/latest/Google.Cloud.Language.V1.TextSpan), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[TextSpan](/dotnet/docs/reference/Google.Cloud.Language.V1/latest/Google.Cloud.Language.V1.TextSpan), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Language.V1](/dotnet/docs/reference/Google.Cloud.Language.V1/latest/Google.Cloud.Language.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Language.V1.dll\n\nConstructors\n------------\n\n### TextSpan()\n\n public TextSpan()\n\n### TextSpan(TextSpan)\n\n public TextSpan(TextSpan other)\n\nProperties\n----------\n\n### BeginOffset\n\n public int BeginOffset { get; set; }\n\nThe API calculates the beginning offset of the content in the original\ndocument according to the\n\\[EncodingType\\]\\[google.cloud.language.v1.EncodingType\\] specified in the API\nrequest.\n\n### Content\n\n public string Content { get; set; }\n\nThe content of the output text."]]