Is there any way to find the end position based on the starting position.
For example, I have the following text:
type AddCommentInput {
ownerId: ID!
clientMutationId: String
}
[index position starts]type AddEnterpriseAdminInput {
clientMutationId: String
success: Boolean
}[index position to look for]
type Actor {
avatarUrl(
size: Int
): URI!
login: String!
resourcePath: URI!
url: URI!
}
I want to find the end position of knowing the starting position
My expected results:
Input: type {objecs}
Output: [ 23 : 80 ] ~ [index at the starting position : index at the end position]
*Note : "type {object}" in my document is unique. You can see the picture to make it easier to understand the request
Is there a way to deal with a case like this?
Thanks and appreciate all contributions
source https://stackoverflow.com/questions/76385005/find-the-end-index-position-based-on-the-starting-index-position
Comments
Post a Comment