C program to remove a substring


















The technical storage or access that is used exclusively for statistical purposes. The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes. Manage options Manage third parties Manage vendors Read more about these purposes.

Accept Deny View preferences Save preferences View preferences. Active Oldest Votes. You may decrease the number of strlen calls by caching str length, decreasing it each time the sub has been removed — Netherwire. Netherwire: Good point, but it makes the code more cumbersome, especially if one wants to avoid computing strlen str if there is no match. Thanks for teasing me I found an even better solution : — chqrlie.

There might be other bugs, can you be more specific and tell me what arguments are causing the segfault? Sign up or log in Sign up using Google. Sign up using Facebook.

Sign up using Email and Password. Post as a guest Name. ToCharArray ;. Write String. Check if current and next character forms ac. If current character is b. Else copy curr char to output string.

WriteLine new String str ;. Previous Find a peak element. Recommended Articles. Remove minimum characters from string to split it into three substrings under given constraints. Find value after N operations to remove N characters of string S with given constraints.

Article Contributed By :. There is a reason people are assigned homework, and it isn't so they can run to an online forum and beg for help. Actually, I tried to write something like below.

I guess you can help me now? Why do you use strlen? You don't need it. Thanks for your help but,I don't know pointers very well.



0コメント

  • 1000 / 1000