CALL KINSTR
This page was last modified 03:32, 29 November 2016 by Mars2000you.

Contents

Effect

Returns the position A of the first occurrence of a B$ substring in A$ string, starting from an optional offset.

It's the same command as INSTR, but adapted for Japanese and Korean characters.

Syntax

CALL KINSTR(A,[<offset>,] A$,B$)

Parameters

A is a value that will be returned by this instruction

<offset> is optional, it's a number between 1 and 255 - Default value is 1.

A$ is a a string (between quotation mark)

B$ is a substring (between quotation mark) of A$

For a correct working, it's better to use Hangul characters regrouped in blocks.

Example

CALL KINSTR(A,"TOKYO伯京トウキョウ","ト"):PRINT A
8

Special values

Value of A will be
- offset value if B$ substring is empty and offset is not larger as the length of string A$ and A$ string is not empty
- value 0 if A$ string is empty OR B$ substring is not found in A$ string OR offset is larger as the length of string A$

Related to

CALL KLEN, INSTR

Compatibility

Hangul BASIC version 3 or higher, Kanji BASIC