File Exchange

image thumbnail

Get position of paired brackets in a string

version 1.0.0 (1.69 KB) by Newport Quantitative
Get position of the other paired bracket (nested) in a string

0 Downloads

Updated 22 Jan 2019

View License

POS2 = GETBRACKETPAIRpos1(STR,POS1) gets the bracket pos1ition in a
string given the position of the other paired bracket.

Input:
STR : string (can be a nested string)
POS1: pos1ition of a bracket (can be either left or right)

Note:
1. Any bracket of '{[(<>)]}' can be recognized.
2. Input position can be either left or right bracket.
3. Mixed pair types are sup

Cite As

Newport Quantitative (2019). Get position of paired brackets in a string (https://www.mathworks.com/matlabcentral/fileexchange/70060-get-position-of-paired-brackets-in-a-string), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux