Finding a sting - function strfind, MATLAB in Engineering

Finding a sting - function strfind:

The function strfind does necessarily similar thing, except that the order of the arguments does make dissimilarity. The common form is strfind(string, substring); it finds all the occurrences of the substring within the string, and it returns the subscripts.

>> strfind('abcdeabcde','e')

ans =

5  10

 

For both the strfind and findstr, if there are no occurrences, then the empty vector is returned.

>> strfind('abcdeabcde','ef')

ans =

[]

 

 

Posted Date: 10/20/2012 5:29:37 AM | Location : United States







Related Discussions:- Finding a sting - function strfind, Assignment Help, Ask Question on Finding a sting - function strfind, Get Answer, Expert's Help, Finding a sting - function strfind Discussions

Write discussion on Finding a sting - function strfind
Your posts are moderated
Related Questions
Function fieldnames - structure functions: The function fieldnames will return the names of the fields which are contained in the structure variable. >> pack_fields = fiel

IS Functions for Strings: There are many functions for strings, that return logical true or false. The function isletter returns the logical true when the character is a lette

Use of Nested if-else statements: By using the nested if-else to select from among the three possibilities, not all the conditions should be tested. In this situation, if x is

Expanding a function: The expand function will multiply out terms, and factor will do the opposite: >> expand((x+2)*(x-1)) ans = x^2 x-2 >> factor(ans)

Implementation of binary search: The binary search can be implemented as a recursive function. The recursive function below also implements this binary search algorithm. It re

Simplification Functions: There are numerous functions which work with expressions, and simplify the terms. Not all the expressions can be simplified, but the simplify functio

Subfunctions: Though, it is possible to have more than one function in a given M-file. For illustration, if one function calls the other, the first function would be the prima

Passing Structures to Functions: The whole structure can be passed to a function, or separate fields can be passed. For illustration, here are the two distinct versions of a f

Illustration of Image processing: This displays that there are 64 rows, or in another word, 64 colors, in this specific colormap. It also displays that the first five colors a

Appending variables to the Mat-File: Appending to the file adds to what has been saved in a file, and is accomplished by using the -append option. For illustration, supposing